![我该如何删除因 Brother MFC-8840 deb 驱动程序而损坏的 dpkg?](https://linux22.com/image/870782/%E6%88%91%E8%AF%A5%E5%A6%82%E4%BD%95%E5%88%A0%E9%99%A4%E5%9B%A0%20Brother%20MFC-8840%20deb%20%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%E8%80%8C%E6%8D%9F%E5%9D%8F%E7%9A%84%20dpkg%EF%BC%9F.png)
我似乎无法删除包裹。
我试过 dpkg --purge 和 apt-get purge。但是,似乎都没有真正删除该软件包。该软件包是 mfc8840dlpr (1.1.2-1)。
有什么方法可以使这个问题更清楚,或更具体吗?
有人似乎已经解决了类似的问题,如下所示,但并没有太多关于如何实际删除包的信息:
如何修复 Brother MFC-7340 deb 驱动程序损坏的 dpkg
有其他人在安装 Brother 打印机驱动程序 .deb 时遇到过这个问题吗?
我的尝试的输出如下:
(Reading database ... 471289 files and directories currently installed.)
Removing mfc8840dlpr (1.1.2-1) ...
/var/lib/dpkg/info/mfc8840dlpr.postrm: 3: /var/lib/dpkg/info/mfc8840dlpr.postrm: /etc/init.d/lpd: not found
dpkg: error processing package mfc8840dlpr (--remove):
subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
mfc8840dlpr
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ dpkg --purge mfc8840dlpr
dpkg: error: requested operation requires superuser privilege
$ sudo dpkg --purge mfc8840dlpr
(Reading database ... 471289 files and directories currently installed.)
Removing mfc8840dlpr (1.1.2-1) ...
/var/lib/dpkg/info/mfc8840dlpr.postrm: 3: /var/lib/dpkg/info/mfc8840dlpr.postrm: /etc/init.d/lpd: not found
dpkg: error processing package mfc8840dlpr (--purge):
subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
mfc8840dlpr
$ sudo dpkg --purge mfc8840dlpr
$ sudo apt-get purge mfc8840dlpr
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
mfc8840dlpr:i386
0 upgraded, 0 newly installed, 1 to remove and 12 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 471289 files and directories currently installed.)
Removing mfc8840dlpr (1.1.2-1) ...
/var/lib/dpkg/info/mfc8840dlpr.postrm: 3: /var/lib/dpkg/info/mfc8840dlpr.postrm: /etc/init.d/lpd: not found
dpkg: error processing package mfc8840dlpr (--remove):
subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
mfc8840dlpr
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
我刚刚安装了该软件包并能重现该问题。
此命令解决了该问题:
sudo rm /var/lib/dpkg/info/mfc8840dlpr.*
这将删除 mfc8840dlpr 包的安装文件,从而阻止任何进一步的自动完成安装尝试。这还会使系统处于一种状态,认为 mfc8840dlpr 包已安装,而实际上可能并未安装。