简体   繁体   English

如何在 CentOS 上卸载 MongoDb-Server

[英]How to Uninstall MongoDb-Server on CentOS

I have installed a mongodb instance once, but it stops running for a reason that I could not managed to solve.我已经安装了一个 mongodb 实例,但由于我无法解决的原因它停止运行。 So I installed MongoDb 3.4 by using offical docs .所以我使用官方文档安装了 MongoDb 3.4。 There are 5 modules according to the installer.根据安装程序,有 5 个模块。 One of them is mongodb-org-server which install mongod (mongo daemonized).其中之一是mongodb-org-server ,它安装mongod (mongo 守护进程)。 When I run the command:当我运行命令时:

sudo yum install -y mongodb-org

It installs all of modules except mongodb-org-server.它安装了除 mongodb-org-server 之外的所有模块。 It says it's installed.说安装好了。 However, when I run mongod, I get there is no such a command.但是,当我运行 mongod 时,我发现没有这样的命令。 After that I tried to remove all of the modules:之后,我尝试删除所有模块:

sudo yum erase $(rpm -qa | grep mongodb-org)

It does not manage to remove mongodb-org-server and throws the error below:它无法删除 mongodb-org-server 并引发以下错误:

Running Transaction
Erasing: mongodb-org-3.4.1-1.el6.x86_64                                                                                                                                1/5
error reading information on service mongod: No such file or directory
error: %preun(mongodb-org-server-3.4.1-1.el6.x86_64) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package mongodb-org-server

How I can fix this?我该如何解决这个问题? I'll glad for your helps.我会很高兴你的帮助。 Thanks.谢谢。

I fixed the issue.我解决了这个问题。 Reinstalled the server package and deleted successfully.重新安装服务器包,删除成功。

sudo yum reinstall -y mongodb-org-server.x86_64

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM