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",然后回车进入数据库

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