Saturday, 22 December 2012

MongoDB Installion on Ubuntu 12.04


How to Install MongoDB on Ubuntu 12.04
Go to the terminal in Ubuntu and type
      sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
      sudo echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | sudo tee -a /etc/apt/sources.list.d/10gen.list
      sudo apt-get -y update
      sudo apt-get -y install mongodb-10gen

Here's an explanation of each :
  • The `apt-key` call registers the public key of the custom 10gen MongoDB repository.
  • A custom 10gen repository list file is created in /etc/source.list.d/ folder which contains the location of the MongoDB binaries.
  • Repository is updated so that new packages can be registered locally.
  • Aptitude is told to install MongoDB.
After all these command your MongoDB starting running. You can type
mongo
on the terminal to start mongo shell for executing your mongodb commands.

1 comment: