Install MongoDB

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/?_ga=1.25950975.395536525.1415167309

(1)Import the public key used by package management system

The Ubuntu package management tools ensure package consistency and authenticity by requiring that 

distributors sign packages with GPG keys. Issue the following command to import the MongoDB public

GPG key:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

(2)Create a list file for MongoDB

Create the /etc/apt/sources.list.d/mongdb-org-3.0.list list file using the following command:

echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list

(3)Reload local package database

Issue the following command to reload the local package database:

sudo apt-get update

(4)Install the MongoDB package

You can install either the lastest version of MongoDB or a specific version of MongoDB

   You can install the latest stable version of MongoDB

sudo apt-get install -y mongodb-org

   Or, install a specific release of MongoDB

  

sudo apt-get install -y mongodb-org=3.0.5 mongodb-org-server=3.0.5 mongodb-org-shell=3.0.5 mongodb-org-mongos=3.0.5 mongodb-org-tools=3.0.5
原文地址:https://www.cnblogs.com/iwangzheng/p/4692187.html