How to: Uninstallation of MongoDB on Ubuntu

MongoDB is one of the document oriented open source database developed in c++, first come into shape in 2007 when in order to overcome the shortfall of existing database while working for an advertising company “DoubleClick” development team has decided to go further rather than struggling with database.  The team of this advertising company was frustrated with their existing DB as the team was struggling for scalability and agility both on their existing DB.  While facing such issues Dwight Merriman, Eliot Horowitz and Kevin Ryan has got an idea and they took this up further to develop MongoDB.  They have founded MongoDB Inc.

Like any other DB MongoDB also supports multi platform.  MongoDB Inc. has released many binaries of every version which runs on different platform like OSx, Windows and different flavour of Unix like RedHat, SUSE, Amazon Linux etc.  Besides these there are enterprise edition releases as well which also supports on various platform.

Un-installation of MongoDB is pretty straight forward.

In first step you have to stop the instances running on the server which we are going to remove.  To stop this, we have to execute:

service mongodb stop

Once instances are shutdown, we can proceed with the un-installation of MongoDB.
sanjeeva@mishika:/lib/systemd/system$ sudo apt-get purge mongodb-org*
[sudo] password for sanjeeva:
Reading package lists… Done
Building dependency tree
Reading state information… Done
Note, se ‘mongodb-org-unstable-tools’ for glob ‘mongodb-org*’
Note, selecting ‘mongodb-org-mongos’ for glob ‘mongodb-org*’
Note, selecting ‘mongodb-org-tools’ for glob ‘mongodb-org*’
Note, selecting ‘mongodb-org-unstable-server’ for glob ‘mongodb-org*’
Note, selecting ‘mongodb-org-unstable-shell’ for glob ‘mongodb-org*’
Note, selecting ‘mongodb-org-shell’ for glob ‘mongodb-org*’
Note, selecting ‘mongodb-org-unstable-mongos’ for glob ‘mongodb-org*’
Note, selecting ‘mongodb-org-unstable’ for glob ‘mongodb-org*’
Note, selecting ‘mongodb-org’ for glob ‘mongodb-org*’
Note, selecting ‘mongodb-org-server’ for glob ‘mongodb-org*’
Package ‘mongodb-org-unstable’ is not installed, so not removed
Package ‘mongodb-org-unstable-mongos’ is not installed, so not removed
Package ‘mongodb-org-unstable-server’ is not installed, so not removed
Package ‘mongodb-org-unstable-shell’ is not installed, so not removed
Package ‘mongodb-org-unstable-tools’ is not installed, so not removed
The following packages will be REMOVED:
mongodb-org* mongodb-org-mongos* mongodb-org-server* mongodb-org-shell* mongodb-org-tools*

The following held packages will be changed:

mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools

0 upgraded, 0 newly installed, 5 to remove and 335 not upgraded.

After this operation, 174 MB disk space will be freed.

Do you want to continue? [Y/n] Y
(Reading database … 172702 files and directories currently installed.)
Removing mongodb-org (3.0.14) …
arg: remove
Purging configuration files for mongodb-org (3.0.14) …
Removing mongodb-org-mongos (3.0.14) …
Removing mongodb-org-server (3.0.14) …
Purging configuration files for mongodb-org-server (3.0.14) …
Removing mongodb-org-shell (3.0.14) …
Removing mongodb-org-tools (3.0.14) …
Processing triggers for man-db (2.7.5-1) …
sanjeeva@mishika:/lib/systemd/system$ sudo rm -r /var/log/mongodb
sanjeeva@mishika:/lib/systemd/system$ sudo rm -r /var/lib/mongodb
rm: cannot remove ‘/var/lib/mongodb’: No such file or directory
sanjeeva@mishika:/lib/systemd/system$

 

 

3 thoughts on “How to: Uninstallation of MongoDB on Ubuntu

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.