Skip to content

Instantly share code, notes, and snippets.

@leommoore
Last active November 27, 2018 02:30
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save leommoore/10660095 to your computer and use it in GitHub Desktop.
Save leommoore/10660095 to your computer and use it in GitHub Desktop.
MongoDB Install Script

#MongoDB Install Script

echo -----------------------------------------------------------------
echo -                    Mongo - Ubuntu 14.04                       -
echo -----------------------------------------------------------------

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

echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list

sudo apt-get update

#This is to install a specific version
#sudo apt-get install mongodb-org=2.6.1 mongodb-org-server=2.6.1 mongodb-org-shell=2.6.1 mongodb-org-mongos=2.6.1 mongodb-org-tools=2.6.1

#Pin the version to a specific version to top it updating automatically
#echo "mongodb-org hold" | sudo dpkg --set-selections
#echo "mongodb-org-server hold" | sudo dpkg --set-selections
#echo "mongodb-org-shell hold" | sudo dpkg --set-selections
#echo "mongodb-org-mongos hold" | sudo dpkg --set-selections
#echo "mongodb-org-tools hold" | sudo dpkg --set-selections

#This is to install the latest stable version
sudo apt-get install -y mongodb-org

#If you want to install a specific version
#apt-get install mongodb-org=2.6.0 mongodb-org-server=2.6.0 mongodb-org-shell=2.6.0 mongodb-org-mongos=2.6.0 mongodb-org-tools=2.6.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment