我在 ubuntu 12.04 上尝试安装 bind9 时遇到错误
sudo aptitude install bind9
The following NEW packages will be installed:
bind9{b}
0 packages upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 336 kB of archives. After unpacking 962 kB will be used.
The following packages have unmet dependencies:
bind9 : Depends: libbind9-80 (= 1:9.8.1.dfsg.P1-4) but 1:9.8.1.dfsg.P1-4ubuntu0.5 is installed.
Depends: libdns81 (= 1:9.8.1.dfsg.P1-4) but 1:9.8.1.dfsg.P1-4ubuntu0.5 is installed.
Depends: libisc83 (= 1:9.8.1.dfsg.P1-4) but 1:9.8.1.dfsg.P1-4ubuntu0.5 is installed.
Depends: libisccc80 (= 1:9.8.1.dfsg.P1-4) but 1:9.8.1.dfsg.P1-4ubuntu0.5 is installed.
Depends: libisccfg82 (= 1:9.8.1.dfsg.P1-4) but 1:9.8.1.dfsg.P1-4ubuntu0.5 is installed.
Depends: liblwres80 (= 1:9.8.1.dfsg.P1-4) but 1:9.8.1.dfsg.P1-4ubuntu0.5 is installed.
Depends: bind9utils (= 1:9.8.1.dfsg.P1-4) but it is not going to be installed.
Internal error: the solver Install(avahi-daemon:i386 0.6.30-5ubuntu2 <libnss-mdns:amd64 0.10-3.2 -> {avahi-daemon:amd64 0.6.30-5ubuntu2 avahi-daemon:i386 0.6.30-5ubuntu2}>) of a supposedly unresolved dependency is already installed in step 21
Internal error: the solver Install(lsb-base:amd64 4.0-0ubuntu20 <avahi-daemon:i386 0.6.30-5ubuntu2 -> {lsb-base:amd64 4.0-0ubuntu20 lsb-base:amd64 4.0-0ubuntu20.2}>) of a supposedly unresolved dependency is already installed in step 37
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) bind9 [Not Installed]
Accept this solution? [Y/n/q/?] Y
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
我该如何处理?
回答以下评论
sudo apt-cache policy bind9 libbind9-80
[sudo] password for deel:
bind9:
Installed: (none)
Candidate: 1:9.8.1.dfsg.P1-4
Version table:
1:9.8.1.dfsg.P1-4 0
500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
libbind9-80:
Installed: 1:9.8.1.dfsg.P1-4ubuntu0.5
Candidate: 1:9.8.1.dfsg.P1-4ubuntu0.5
Version table:
*** 1:9.8.1.dfsg.P1-4ubuntu0.5 0
100 /var/lib/dpkg/status
1:9.8.1.dfsg.P1-4 0
500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
答案1
问题很简单,你以某种方式安装了一些绑定依赖项的高级版本,而这些依赖项不在主存储库中。 解决此问题的方法是让 aptitude 降级软件包。
sudo aptitude update
sudo aptitude install bind9=1:9.8.1.dfsg.P1-4 libbind9-80=1:9.8.1.dfsg.P1-4 libdns81=1:9.8.1.dfsg.P1-4 libisc83=1:9.8.1.dfsg.P1-4 libisccc80=1:9.8.1.dfsg.P1-4 libisccfg82=1:9.8.1.dfsg.P1-4 liblwres80=1:9.8.1.dfsg.P1-4
sudo aptitude safe-upgrade
如果你想让 aptitude 自己解决依赖关系,你只需要问n
这个问题:
保留以下软件包的当前版本:
1)bind9[未安装]
接受这个解决方案吗?
然后 aptitude 会提供另一个解决方案,也就是重要的“降级”。正如您所看到的,提供的解决方案保持 bind9 处于卸载状态,这就是您最终没有安装它的原因。
您是如何得出结论说我拥有的软件包不在存储库中的?是因为 .dfsg.P1 扩展名还是其他原因?
apt-cache policy
列出所有软件包的来源和版本,在您的情况下,这些软件包仅存在于 中/var/lib/dpkg/status
,这被解释为该软件包仅存在于本地,而不存在于其他存储库中。以下软件包示例表明 位于存储库和本地:
apt-cache policy aptitude
aptitude:
Installed: 0.6.8.1-2ubuntu2
Candidate: 0.6.8.1-2ubuntu2
Version table:
*** 0.6.8.1-2ubuntu2 0
500 http://archive.ubuntu.com/ubuntu/ raring/main amd64 Packages
100 /var/lib/dpkg/status
/var/lib/dpkg/status
如您所见,和 Ubuntu 存储库中的版本相同。
答案2
当系统询问您是否接受解决方案 (Y/n/q) 时,按n
。Aptitude 将提供新的解决方案,然后点击y
。它很可能会起作用!
干杯,