能力“为什么”和“为什么不”是什么意思?

能力“为什么”和“为什么不”是什么意思?

摘自手册:

命令 why 会查找安装命令行中指定的软件包的依赖关系链,如上所示。请注意,aptitude 在本例中生成的依赖关系只是一个建议。这是因为当前安装在这台计算机上的软件包都不依赖或推荐 kdepim 软件包;如果有更强的依赖关系,aptitude 会显示它。

相比之下,why-not 发现了导致与目标包冲突的依赖链:

就我而言(Ubuntu 14.04.2 LTS \n \l),我正在尝试安装libdbus-1-3:i386

$ sudo apt-get install libdbus-1-3:i386
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:
 libdbus-1-3:i386 : Depends: libc6:i386 (>= 2.10) but it is not going to be installed
 unity-control-center : Depends: libcheese-gtk23 (>= 3.4.0) but it is not going to be installed
                        Depends: libcheese7 (>= 3.0.1) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

我尝试了aptitude whyaptitude why-not希望获得有关安装失败原因的更多信息。

$ sudo aptitude why libdbus-1-3:i386
p   upstart:i386 Provides upstart                     
p   upstart:i386 Depends  libdbus-1-3:i386 (>= 1.2.16)

$ sudo aptitude why-not libdbus-1-3:i386
Unable to find a reason to remove libdbus-1-3:i386.

$ sudo aptitude why libc6:i386
p   sqlite3:i386 Provides sqlite3            
p   sqlite3:i386 Depends  libc6:i386 (>= 2.4)

$ sudo aptitude why-not libc6:i386
p   sqlite3:i386 Provides  sqlite3            
p   sqlite3:i386 Depends   libc6:i386 (>= 2.4)
p   libc6:i386   Conflicts libc6-xen:i386     
p   libc6:i386   Provides  libc6-xen:i386

但是我不明白输出的含义。有人能帮帮我吗?

答案1

能力倾向why

简而言之,aptitude命令why试图说明为什么应该安装某个软件包或为什么该软件包已安装在系统中。例如,在我的系统(Ubuntu 16.04)中,当我运行 时aptitude why nautilus-data,它显示

i   unity-settings-daemon Depends nautilus-data (>= 2.91.3-1)

这意味着unity-settings-daemon取决于nautilus-data并且这就是安装它的原因,由i最左侧的列指示。

再次,当我运行它时aptitude why edubuntu-desktop,它说,

Unable to find a reason to install edubuntu-desktop.

因为我安装的软件包都没有依靠或者建议依靠建议是 apt 的内部术语)edubuntu-desktop

能力倾向why-not

why-not与 正好相反why。它试图找出某个包不应该安装或如果已经安装则应该删除的原因。

例如,当我输入时aptitude why-not mate-power-manager:i386,它说

i   mate-power-manager Conflicts mate-power-manager:i386

这意味着我的安装mate-power-manager:amd64将与之冲突mate-power-manager:i386(因为我的系统是 amd64 安装,所以它没有明确提到amd64)。

手册页的相关部分非常清楚。但包括它会使答案太长。以下是aptitude 手册


关于你的问题

当您尝试安装时libdbus-1-3:i386,此处的消息显示

The following packages have unmet dependencies:
 libdbus-1-3:i386 : Depends: libc6:i386 (>= 2.10) but it is not going to be installed
 unity-control-center : Depends: libcheese-gtk23 (>= 3.4.0) but it is not going to be installed
                        Depends: libcheese7 (>= 3.0.1) but it is not going to be installed

软件包libdbus-1-3:i386需要libc6:i386 (>= 2.10)但无法安装。此外,软件包unity-control-center依赖于libcheese-gtk23 (>= 3.4.0)libcheese7 (>= 3.0.1)无法安装。

无法安装的原因有很多,包括缺少所需的软件包的特定版本或者与已安装的版本冲突等。

相关内容