问题描述
当我使用 apt-get upgrade & apt-get autoremove
和每个 apt-get [Something]..
以及尝试安装应用程序时,我都会收到此错误:
Errors were encountered while processing:
man-db
E: Sub-process /usr/bin/dpkg returned an error code (1)
最佳方案
答案中没有提到对我有用的解决方案,我尝试了提到 here on Ubuntu Forums 的解决方案,执行命令
sudo dpkg -i --force-all [deb file path]
那行得通。
次佳方案
请阅读下面的评论。这可能是在您的系统上运行并创建不可恢复状态的危险命令。 (这些行已被注释掉以防止 copy-and-paste sysadmin’ing)。
简单有效,我试过了!!
sudo -s
# cd /var/cache/debconf
# rm *.dat
apt-get update && apt-get upgrade
享受 😉
第三种方案
您可能还想知道您可以使用 dpkg --audit
来查看实际问题是什么。
如果输出类似于:
The following packages are in a mess due to serious problems during installation.
They must be reinstalled for them (and any packages that depend on them)
to function properly:
gcdemu A GNOME panel applet to control CDEmu daemon
The following packages have been unpacked but not yet configured.
They must be configured using dpkg --configure or the configure
menu option in dselect for them to work:
cdemu-daemon CDEmu daemon
cdemu-client A simple command-line client to control CDEmu daemon
The following packages are only half configured, probably due to problems
configuring them the first time. The configuration should be retried using
dpkg --configure <package> or the configure menu option in dselect:
transmission-daemon lightweight BitTorrent client (daemon)
vhba-dkms VHBA virtual host bus adapter module
您可以运行命令:dpkg --configure <packagename>
dpkg --configure cdemu-daemon
为了
Reconfigure an unpacked package.
If -a or --pending is given instead of package, all unpacked but unconfigured
packages are configured.
此外,您可以使用:
sudo apt-get -f install
sudo apt-get --reinstall install gcdemu
修复乱七八糟的包裹。
此处的示例:http://ubuntuforums.org/archive/index.php/t-1502826.html
第四种方案
社区维基答案 – 由 OP 解决
通过运行以下终端命令解决了此问题:
sudo dpkg-reconfigure -phigh -a
第五种方案
您必须使用 sudo 运行这些命令,以便它们可以使用超级用户凭据执行示例:
sudo apt-get autoremove "NAME OF PACKAGE HERE"