monteecristoo’s blog

mongoDB uninstall

mongoDB unistall

To completely remove MongoDB from a system, you must remove the MongoDB applications themselves, the configuration files, and any directories containing data and logs. The following section guides you through the necessary steps.

1) Stop MongoDB

Stop the mongod process by issuing the following command:

     sudo service mongod stop

2) Remove Packages.

Remove any MongoDB packages that you had previously installed.

     sudo apt-get purge mongodb-org*

3) Remove Data Directories.

Remove MongoDB databases and log files.

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



** unistall 時に下記のエラーが発生した場合

dpkg: error processing package mongodb-org (--configure):
dependency problems - leaving unconfigured
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)


touch /etc/init.d/mongod