在尝试升级(sudo apt-get upgrade
)Ubuntu 12.04 时,我有一对软件包会因 dbus 依赖项而引发以下 apt-get install 错误:
dpkg: error processing dbus (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of accountsservice:
accountsservice depends on dbus; however:
Package dbus is not configured yet.
dpkg: error processing accountsservice (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
dbus
accountsservice
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
针对 dpkg 返回错误的类似问题提供的解决方案是使用:
dpkg --configure -a
apt-get install -f
两者都没有解决问题,并产生了相同的错误输出。在某些情况下,aptitude 可能比 更好apt-get
。解决方案是使用aptitude install -f
:
aptitude install -f
解释:
特殊情况下,aptitude install
不带任何参数将执行任何已存储/待处理的操作。当-f
给出该选项时,aptitude 在尝试修复损坏软件包的依赖关系时会更加积极,即使这意味着忽略命令行上请求的操作。