这看起来似乎是一个不太复杂的依赖冲突,但我远不是一个合适的专家。我找不到与我有同样问题的人(尽管我不知道我做了什么导致此错误)。
背景:我已经配置了 Google Chrome 的存储库。当我尝试安装它时,dpkg 崩溃了:
⚡ LANG=en_US.UTF-8 sudo apt install google-chrome-stable
Reading package lists... Done
[TRUNCATED]
The following packages have unmet dependencies:
google-chrome-stable : Depends: libpango1.0-0 (>= 1.14.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
如果我尝试安装 libpango1.0-1:
⚡ LANG=en_US.UTF-8 sudo apt install libpango1.0-0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libpango1.0-0 : Depends: libpango-1.0-0 (= 1.40.1-1ubuntu1) but 1.40.3-2~ubuntu16.10.1 is to be installed
Depends: libpangocairo-1.0-0 (= 1.40.1-1ubuntu1) but 1.40.3-2~ubuntu16.10.1 is to be installed
Depends: libpangoft2-1.0-0 (= 1.40.1-1ubuntu1) but 1.40.3-2~ubuntu16.10.1 is to be installed
Depends: libpangoxft-1.0-0 (= 1.40.1-1ubuntu1) but 1.40.3-2~ubuntu16.10.1 is to be installed
E: Unable to correct problems, you have held broken packages.
这个输出对apt policy
我来说看起来很奇怪:
⚡ LANG=en_US.UTF-8 apt policy libpango-1.0-0
libpango-1.0-0:
Installed: 1.40.3-2~ubuntu16.10.1
Candidate: 1.40.3-2~ubuntu16.10.1
Version table:
*** 1.40.3-2~ubuntu16.10.1 100
100 /var/lib/dpkg/status
1.40.1-1ubuntu1 500
500 http://fr.archive.ubuntu.com/ubuntu yakkety/main amd64 Packages
1.40.3-2~ubuntu16.10.1
Ubuntu 的档案库中只有 版本,那么这个版本从何而来1.40.1-1ubuntu1
?问题似乎出在这里?
我原本以为这是 Chrome 独有的,但它也发生在其他软件包中,例如 unity-editor(Linux 的 Unity 3D 编辑器,从 .deb 安装)。
apt
还建议我运行apt -f install
。如果我这样做,它只会彻底卸载“损坏的”Google Chrome,而不会修复任何内容。
答案1
所以,我昨天很迷茫,但是......再次看一下这个问题,它似乎更清晰了。
我对 的输出的直觉apt policy
是正确的,我不知道怎么回事,但是安装了较新的 libpango 版本,至少比 Ubuntu 提供的版本更新:。版本冲突来自这里1.40.3-2~ubuntu16.10.1
。1.40.1-1ubuntu1
因此,我已将那些与 libpango 相关的库降级为主存储库提供的版本:
sudo apt install libpango-1.0-0=1.40.1-1ubuntu1 libpangocairo-1.0-0=1.40.1-1ubuntu1 libpangoft2-1.0-0=1.40.1-1ubuntu1 libpangoxft-1.0-0=1.40.1-1ubuntu1
apt policy
该命令中列出的库就是上面的输出中列出的库。
轰隆隆,成功了!
只是有点惊讶,没有人发表答案或小评论,你们不喜欢再耕耘声誉了吗?