Install Specific Version of MongoDB in Ubuntu

To Install specific version of MongoDB, We have to pin particular version of MongoDB. In the section we will update you how to install MongoDB v2.6.
1. Import the public key used by package management system.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
2. Create a list file for for MongoDB.
Create the /etc/apt/sources.list.d/mongodb.list list file using the following command:
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
3. Reload local database package.
sudo apt-get update
4. Pin specific version of MongoDB from the command given below.
sudo apt-get install -y mongodb-org=2.6.10 mongodb-org-server=2.6.10 mongodb-org-shell=2.6.10 mongodb-org-mongos=2.6.10 mongodb-org-tools=2.6.10
5. You have successfully installed MongoDB in your Ubuntu machine.
6. Now, Start the services of MongoDB from the command given below.
sudo service mongod start
Thanks for going through the documentation, hope you like our posts.

No comments:

Post a Comment