Skip to content

Instantly share code, notes, and snippets.

@fernandojunior
Last active August 29, 2015 14:07
Show Gist options
  • Save fernandojunior/367360e12233ca82a1ce to your computer and use it in GitHub Desktop.
Save fernandojunior/367360e12233ca82a1ce to your computer and use it in GitHub Desktop.
Shell script to install mongodb 10gen on ubuntu
#!/bin/bash
# Script based on How to install mongoDB on Ubuntu Tutorial (http://www.mkyong.com/mongodb/how-to-install-mongodb-on-ubuntu/)
# By Fernando Felix do Nascimento Junior
# become superuser
sudo su
# add mongodb 10gen package to /etc/apt/sources.list.d
touch /etc/apt/sources.list.d/mongo.list
echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" > /etc/apt/sources.list.d/mongo.list
# 10gen package required GPG key, imports it
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
# update your apt-get list
sudo apt-get update
# install mongodb-10gen
sudo apt-get install mongodb-10gen -y
# starting MongoDB
sudo service mongodb start
# stoping MongoDB
sudo service mongodb stop
# restarting MongoDB
sudo service mongodb restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment