Last active
August 29, 2015 14:09
-
-
Save yamishi13/5264bd6097ee562def33 to your computer and use it in GitHub Desktop.
MongoDB Ubuntu installer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Verify it is not being run as root | |
if [ $EUID -eq 0 ] ; then | |
echo "Don't run this script as root if you don't want to have nightmares at night" >> /dev/stderr | |
exit 1 | |
fi | |
#add the key for the repo | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | |
#add the repo | |
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list | |
#update and install | |
sudo apt-get update | |
sudo apt-get install -y mongodb-org | |
#restart service | |
sudo service mongod restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment