我前几天去安装bsnes,但由于某种原因,安装失败了。现在,我无法更新、安装新的软件包或者执行基本的apt-get命令,因为它们都试图处理这个损坏的软件包并失败了。尝试安装一个新软件包也注定会遭遇同样的命运。
我收到的错误信息是:
我在Google和Ask Ubuntu上搜索了很久,但没有找到有效的解决方案。
常见建议的修复方法是运行以下命令:
这个方法不起作用。apt-get命令都以与上述相同的错误失败,而dpkg命令则没有帮助。他们经常建议通过Synaptic或命令行清除它,但这也失败了。
我收到的错误信息是:
Setting up google-chrome-stable (33.0.1750.152-1) ...
/var/lib/dpkg/info/google-chrome-stable.postinst: 124: /var/lib/dpkg/info/google-chrome-stable.postinst: update-alternatives: not found
dpkg: error processing google-chrome-stable (--configure):
subprocess installed post-installation script returned error exit status 127
Setting up bsnes (0.088-7) ...
/var/lib/dpkg/info/bsnes.postinst: 5: /var/lib/dpkg/info/bsnes.postinst: update-alternatives: not found
dpkg: error processing bsnes (--configure):
subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
google-chrome-stable
bsnes
E: Sub-process /usr/bin/dpkg returned an error code (1)
我在Google和Ask Ubuntu上搜索了很久,但没有找到有效的解决方案。
常见建议的修复方法是运行以下命令:
sudo apt-get clean && sudo apt-get autoremove
sudo apt-get -f install
sudo dpkg --configure -a
这个方法不起作用。apt-get命令都以与上述相同的错误失败,而dpkg命令则没有帮助。他们经常建议通过Synaptic或命令行清除它,但这也失败了。
dpkg
并不总是有帮助的。 - Danatela/var/lib/dpkg/info/[package_name].prerm
,但是你的帖子给了我正确的方向。这绝对是面向高级用户的,风险很大! - sмurf.prerm
和.postrm
文件可以解决问题。 - fuser.prerm
文件等也适用,终于有了几乎等同于rpm -e --noscripts
的方法 :) - rogerdpacksudo apt-get update && sudo apt-get upgrade
。然后我在/var/lib/dpkg/info/dokku.prerm
中注释掉了所有内容,问题就解决了。 - Arda Basoglu