无法从 debian 中删除、清除、卸载 mongodb

Can't remove, purge, unistall mongodb from debian

我正在尝试重新安装它,因为它有问题。例如,我无法安装 Chromium,因为未配置 mongodb-org-server。但同样的原因我什至不能删除它。

apt-get autoremove --purge mongodb

或者:

apt-get purge mongodb

或者:

apt-get remove --purge mongodb

都以同样的方式结束:

 dpkg: error processing package mongodb-org-server (--configure):
  subprocess installed post-installation script returned error exit status 102
 Errors were encountered while processing:
  mongodb-org-server
 E: Sub-process /usr/bin/dpkg returned an error code (1)

hostnamectl 中关于我机器的一些数据:

  Operating System: Debian GNU/Linux 8 (jessie)
  Kernel: Linux 3.14-2-amd64
  Architecture: x86_64

我该如何解决这个问题?

更新:我tried/I正在尝试的事情

apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 973 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mongodb-org-server (3.0.2) ...
dpkg: error processing package mongodb-org-server (--configure):
 subprocess installed post-installation script returned error exit status 102
Errors were encountered while processing:
 mongodb-org-server

为避免此类问题,您应该只从本机 Debian 存储库安装软件。不幸的是,sloppy/incompetent 3rd 方包导致此类问题并不罕见。

要恢复,请先删除文件 /var/lib/dpkg/info/mongodb-org-server.postinst,然后再尝试 apt-get purge mongodb

删除

中的所有 mongodb 文件

/var/lib/dpkg/info/mongodb

然后

sudo apt purge mongodb-org*

答案归功于:Lazyexpert