libgtk-3-0依赖性问题


12

我一直在尝试更新Ubuntu机器上的标准软件包。除了我运行的某些Windows工具的VirtualBox外,此框上没有任何多余的内容。这是一个输出:

$ sudo apt-get update
[...]
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 libgail-3-0 : Depends: libgtk-3-0 (= 3.6.0-0ubuntu3.2) but 3.6.0-0ubuntu3.1 is installed
 libgtk-3-0 : Depends: libgtk-3-common (= 3.6.0-0ubuntu3.1) but 3.6.0-0ubuntu3.2 is installed
 libgtk-3-bin : Depends: libgtk-3-0 (>= 3.6.0-0ubuntu3.2) but 3.6.0-0ubuntu3.1 is installed

另一个带有-f选项:

$ sudo apt-get -f upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages will be upgraded:
  libgtk-3-0 overlay-scrollbar-gtk3
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
26 not fully installed or removed.
Need to get 0 B/2,397 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 203437 files and directories currently installed.)
Preparing to replace libgtk-3-0:amd64 3.6.0-0ubuntu3.1 (using .../libgtk-3-0_3.6.0-0ubuntu3.2_amd64.deb) ...
Unpacking replacement libgtk-3-0:amd64 ...
dpkg: error processing /var/cache/apt/archives/libgtk-3-0_3.6.0-0ubuntu3.2_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules', which is also in package ibus-gtk3:amd64 1.4.1-7ubuntu1
Preparing to replace overlay-scrollbar-gtk3:amd64 0.2.16+r357-0ubuntu1 (using .../overlay-scrollbar-gtk3_0.2.16+r357-0ubuntu1.1_amd64.deb) ...
Unpacking replacement overlay-scrollbar-gtk3:amd64 ...
dpkg: error processing /var/cache/apt/archives/overlay-scrollbar-gtk3_0.2.16+r357-0ubuntu1.1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/gtk-3.0/modules', which is also in package libcanberra-gtk3-module:amd64 0.29-0ubuntu2
Errors were encountered while processing:
 /var/cache/apt/archives/libgtk-3-0_3.6.0-0ubuntu3.2_amd64.deb
 /var/cache/apt/archives/overlay-scrollbar-gtk3_0.2.16+r357-0ubuntu1.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

这是apt-cache policy所有相关软件包的输出:pastebin d3YcjPmJ。一切似乎都来自官方quantalquantal-updates发布渠道以及官方镜像。

我也试过sudo apt-get -f installsudo apt-get dist-upgradesudo apt-get clean && sudo rm -r /var/cache/apt/archives/,但都导致相同的错误。


是的,我使用新软件包进行了更新,是的,我在升级之前进行了更新
Logan Best

这两个命令的输出都与原始请求中的-f输出相同。
Logan Best

1
您是否尝试过删除/var/cache/apt/archives/目录并再次更新?sudo apt-get clean && sudo rm -r /var/cache/apt/archives/
Lucio

试图和同样的错误。更新的问题。
Logan Best

@LoganBest请尝试以下方法:sudo dpkg -r libgtk-3-0_3.6.0-0ubuntu3.2_amd64.deb && sudo dpkg -r overlay-scrollbar-gtk3_0.2.16+r357-0ubuntu1.1_amd64.deb然后sudo apt-get -f install && sudo apt-get update && sudo apt-get upgrade
Lucio

Answers:


3

好的,如果您仍然遇到此问题,则会发生此问题,因为如果同龄人的版本不同,则某些程序包将无法工作。

libgail-3-0 : Depends: libgtk-3-0 (= 3.6.0-0ubuntu3.2) but 3.6.0-0ubuntu3.1 is installed
libgtk-3-0 : Depends: libgtk-3-common (= 3.6.0-0ubuntu3.1) but 3.6.0-0ubuntu3.2 is installed
libgtk-3-bin : Depends: libgtk-3-0 (>= 3.6.0-0ubuntu3.2) but 3.6.0-0ubuntu3.1 is installed

如您所见,libgail-3-0要求libgtk-3-0为3.6.0-0ubuntu3。2,但libgtk-3-0要求libgtk-3-common为3.6.0-0ubuntu3。1不同的是.1版本。因此,由于libgtk-family不能具有不同的版本,因此apt-get会出现预期的依赖错误。那么如何解决呢?我们使用hold包裹状态:

echo "libgtk-3-bin hold" | sudo dpkg --set-selections
echo "libgtk-3-0 hold" | sudo dpkg --set-selections

这样,您可以正常升级,直到在Ubuntu存储库中解决依赖项冲突为止。

一旦感觉到可以允许升级,请运行:

echo "libgtk-3-bin install" | sudo dpkg --set-selections
echo "libgtk-3-0 install" | sudo dpkg --set-selections

另一个选择是强制安装版本:

sudo apt-get update
sudo apt-get install libgtk-3-0=3.6.0-0ubuntu3.1 libgtk-3-common=3.6.0-0ubuntu3.1 libgtk-3-0=3.6.0-0ubuntu3.1

这将告诉apt-get使用相同的版本号安装所有内容。


0

对于仍然有那些问题的任何人。

我相信当您手动删除某些程序包但不清除它们留下的所有垃圾时它们就会出现。就我而言,我libgtk仍然已经安装了它,但是它是一个较新的版本,所以我想安装它。因此,它真的不知道如何处理不同版本的库。

仅删除libgtk-3-0具有类似问题的和其他软件包后,一切就进行了。

PS。请注意,如果您已完成“ echo "libgtk-3-0 hold" | sudo dpkg --set-selections 那么” ,则必须这样 做 echo "libgtk-3-0 install" | sudo dpkg --set-selections才能删除此软件包。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.