删除损坏的 mongo 服务器包时出错

删除损坏的 mongo 服务器包时出错

提前致谢,我想删除损坏的 mongodb-org-server 包。在安装过程中,我使用

sudo apt-get install mongodb

但是当我删除它时,它卡在 mongodb-org-server 上,并显示

The following packages will be REMOVED:
mongodb-org-server*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 26.6 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 218521 files and directories currently installed.)
Removing mongodb-org-server (3.0.15) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
 subprocess installed pre-removal script returned error exit status 5
Errors were encountered while processing:
 mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

我已经尝试了所有这些命令,但没有发现有用的结果

sudo apt-get --purge remove mongodb-org-server
sudo apt-get autoclean
sudo dpkg --remove --force-remove-reinstreq mongodb-org-server

请帮帮我..!

答案1

我之前遇到过这个问题,最后我不得不进入 mongodb-org-server.prerm(在 /var/lib/dpkg/info/ 中)并注释掉试图停止 mongod.service 的行,然后再使用 apt-get 将其删除。

相关内容