Thursday, 31 March 2016

Install mongodb 3.2.4 in Ubuntu 14.04


1

Import the public key used by the package management system


sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
2. Create a list file for MongoDB
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list

3. Reload local package database.

sudo apt-get update
4

Install the MongoDB packages

Install the latest stable version of MongoDB.

sudo apt-get install -y mongodb-org

 5. Install a specific release of MongoDB.

sudo apt-get install -y mongodb-org=3.2.4 mongodb-org-server=3.2.4 mongodb-org-shell=3.2.4 mongodb-org-mongos=3.2.4 mongodb-org-tools=3.2.4
1

Start MongoDB.

sudo service mongod start

2.  Stop MongoDB

sudo service mongod stop

3. Restart MongoDB.

sudo service mongod restart


4. check the installed version

  mongo --version



**********************************************************************************************************************
Uninstalling previous mongo db versions

Try searching for installed mongo packages with dpkg :
$ sudo dpkg -l | grep mongo
The above command should output a list of packages with mongo in the name.
If files exist on the system, following an apt-get remove mongo, try and run the command again with the --purge switch, using a wildcard search for the name:
sudo apt-get remove mongodb* --purge





No comments:

Post a Comment