MongoDB

Install Old MongoDB 2.4 version

OLD: MongoDB Installation on Ubuntu 12.04 - 2.4 version (no text search)

To list all available packages:

#apt-cache search mongodb

mongodb - object/document-oriented database (metapackage)
mongodb-clients - object/document-oriented database (client apps)
mongodb-dev - object/document-oriented database (development)
mongodb-server - object/document-oriented database (server package)
php5-mongo - MongoDB database driver

... etc

 

These are old packages so update repo:

1. #vi /etc/apt/sources.list.d/mongo.list

deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen

2. #apt-get update   -shows error

W: GPG error: http://downloads-distro.mongodb.org dist Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9ECBEC467F0CEB10

meaning that we need public key for this repo.

3. #apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10

gpg: key 7F0CEB10: public key "Richard Kreuter <richard@10gen.com>" imported

4.Now run

#apt-get update

#apt-cache search mongo

mongodb-10gen - An object/document-oriented database
mongodb-10gen-unstable - An object/document-oriented database
mongodb-10gen-unstable-mongos - An object/document-oriented database
mongodb-10gen-unstable-server - An object/document-oriented database
mongodb-10gen-unstable-shell - An object/document-oriented database
mongodb-10gen-unstable-tools - An object/document-oriented database

.........

Now you can see that 6 new mongodb-10gen apps are added.

 

5. #apt-get install mongodb-10gen

After this operation, 222 MB of additional disk space will be used.
Get:1 http://downloads-distro.mongodb.org/repo/ubuntu-upstart/ dist/10gen mongodb-10gen i386 2.4.12 [87.3 MB]

Visit all distibutions at http://downloads-distro.mongodb.org/repo/

 

6. To list all files which are installed run #dpkg -L mongodb-10gen

Most important files are:

/etc/mongodb.conf   -config file

/usr/bin/mongod    -server

/usr/bin/mongo   -client

 

 

Controlling MongoDB 2.4 on Ubuntu 12.04

# service mongodb start | stop | restart | status

NOTICE: MongoDB 2.6 use: # service mongod start