I am tring to install mongodb but its getting failed again and again. I am getting following error:

mongodb is not found.

I using following command to install mongodb:

sudo apt-get install mongodb
  • Are you using Ubuntu 12.04? Mongodb is a package in Ubuntu 12.10, not 12.04: packages.ubuntu.com/… – imbaer Mar 6 '13 at 8:36
  • Follow the proper instructions mentioned at docs.mongodb.org. Seems like you have skipped added/updated source. – Mayura Mar 6 '13 at 8:36
  • i am new in linux how to add this package in my system – user134866 Mar 6 '13 at 9:19

You cannot install mongodb using:

apt-get install mongo

You need to execute following command to install mongodb on linux:

sudo apt-get install mongodb-server
| improve this answer | |
  • now its found mongodb and its being installing..... – user134866 Mar 6 '13 at 13:15

To install mongodb run the commands:

sudo sh -c "echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' >> /etc/apt/sources.list"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
sudo apt-get update
sudo apt-get install mongodb-10gen

To test connection (wait at least 15 seconds to let the db start up), run the command below.


If the command exits with a error about not being able to connect, then reboot, and log back in as the admin user.

Sometimes MongoDB fails to create a network socket when it is started immediately after installation. It should automatically start

| improve this answer | |

There are 2 ways to install mongodb in ubuntu 12.x :-

(1) use the ubuntu software installation center ,in serach type mongodb

here you will get "Object/document-oriented database (metapackage)" mongdb - install it.

(2) download the mongodb from - http://www.mongodb.org/downloads according to you OS and supported 32/64 bit version and follow this blog:-


if there are ' .deb' package is available then download it and it can directly install by double click , no need to run command and fork any package.

These are easy steps for a new person to install package and software in Ubuntu.

| improve this answer | |

You can install mongodb in ubuntu by using this command:

sudo apt-get install mongo

if this doesn't work, try installing through repository.

| improve this answer | |

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5

echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list

echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list

sudo apt-get update sudo apt-get install -y mongodb-org

sudo apt-get install -y mongodb-org=3.6.0 mongodb-org-server=3.6.0 mongodb-org-shell=3.6.0 mongodb-org-mongos=3.6.0 mongodb-org-tools=3.6.0

| improve this answer | |

First uninstall any Mongo pakages.Then revive your broken packages to install.

Uninstall and remove Mongo packages.

$ sudo apt-get purge mongodb-org*

Check if related directories removed

$ sudo rm -r /var/log/mongodb
$ sudo rm -r /var/lib/mongodb

Recheck for autoremove any remaining mongo packages

$ sudo apt-get autoremove

Configure your directory

$ sudo dpkg --configure -a

Force install anything required

$ sudo apt-get install -f

Re-install from https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

Finally restart your Ubuntu and check status of Mogodb server as you did earlier.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy