首页 > 数据库技术 > 详细

Ubuntu中安装mongodb的问题

时间:2015-09-03 17:46:39      阅读:382      评论:0      收藏:0      [点我收藏+]

1.在终端上运行"sudo apt-get install mongo-org"后出现错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package mongodb-org  //This is the error
并且在运行"apt-get update"后依然是这个错误提示。

2.结果按下面步骤设置后安装成功:

#Step 1:  Import the MongoDB public key 
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

#Step 2: Generate a file with the MongoDB repository url
echo ‘deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen‘ | sudo tee /etc/apt/sources.list.d/mongodb.list

#Step 3: Refresh the local database with the packages
sudo apt-get update

#Step 4: Install the last stable MongoDB version and all the necessary packages on our system
sudo apt-get install mongodb-org
3.这时装好以后应该会自动运行mongod程序,通过"pgrep mongo -l "查看进程是否已经启动:
技术分享

4.在终端输入"mongo",然后回车进入数据库
技术分享


Ubuntu中安装mongodb的问题

原文:http://www.cnblogs.com/zhangty/p/4780362.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!