How can I completely uninstall mongodb 2.6.3?

I am running the following command:

sudo apt-get remove mongodb

And it's giving this output:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'mongodb' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

But mongodb is still installed on my Ubuntu 13.04 system, so how can I uninstall it..?


Solution 1:

Try searching for installed mongo packages with dpkg :

$ sudo dpkg -l | grep mongo

The above command should output a list of packages with mongo in the name.

If files exist on the system, following an apt-get remove mongo, try and run the command again with the --purge switch, using a wildcard search for the name:

sudo apt-get remove mongodb* --purge

Solution 2:

The general methodology here should work (upvoted), but more specifically the MongoDB packages for 2.6+ (assuming you installed them from the official repos) are:

  • mongodb-org (metapackage that will automatically install/remove) the four component packages below
  • mongodb-org-server
  • mongodb-org-client
  • mongodb-org-tools
  • mongodb-org-shell

Hence, if you try removing those packages you should have more success.