Skip to content

Instantly share code, notes, and snippets.

@noleto
Last active January 1, 2016 06:09
Show Gist options
  • Save noleto/8103292 to your computer and use it in GitHub Desktop.
Save noleto/8103292 to your computer and use it in GitHub Desktop.
Install latest MongoDB on Ubuntu
#!/bin/bash
#How to use it?
#wget -O- https://gist.github.com/noleto/8103292/raw/e6a77ef6faa0eab3676287b9a265a15b4d9edee3/install-mongo.sh | sh
LOG_TIME_FORMAT='date +%d-%m-%Y_%T'
echo "------------------------------------------"
echo "Install MongoDB on Ubuntu"
echo "------------------------------------------"
echo "[$($LOG_TIME_FORMAT)] [MONGO] Installing latest stable release..."
#Mongo DB
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
sudo apt-get install mongodb-10gen
echo "------------------------------------------"
mongo --version
echo "------------------------------------------"
echo "[$($LOG_TIME_FORMAT)] [MONGO] Install successful."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment