Uninstalling MongoDB (Against RPM Package Installation)
Select an uninstallation mode based on the installation mode. If the MongoDB database is installed using an RPM package, uninstall it by following the instructions in this section.
- Check and stop the database process. In this example, 112876 is the MongoDB process ID. Replace it with the actual one.
1 2
ps -ef | grep mongod kill -9 112876

- Uninstall the database RPM package.
In the following commands, 3.6.13 indicates the MongoDB version. When installing another version, replace 3.6.13 with the actual version.
1 2
rpm -qa | grep mongodb-3.6.13 rpm -e mongodb-3.6.13-1.el8.aarch64
- Delete the software installation directory and data directory of the database.
1 2 3 4
ll /usr/local/mongo/ ll /data rm -rf /usr/local/mongo/ rm -rf /data
Parent topic: Uninstallation