安装gtk +3时出现“未满足的依赖关系”

尝试按照另一个包的要求安装GTK。

所以我运行了apt-get install libgtk-3-dev

但是获得未满足的依赖项错误。

产量

  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: libgtk-3-dev : Depends: libgdk-pixbuf2.0-dev (>= 2.30.0) but it is not going to be installed Depends: libpango1.0-dev (>= 1.36.7) but it is not going to be installed Depends: libcairo2-dev (>= 1.14.0) but it is not going to be installed E: Unable to correct problems, you have held broken packages. 

我知道这个错误通常是由于包装破损而发生的。 但apt-get install -f显示没问题。

apt-get install -f输出

阅读包列表…完成构建依赖关系树
读取状态信息…完成0升级,0新安装,0删除,0未升级。

也没有apt-mark showhold输出为apt-mark showhold的apt-cache输出sudo apt-cache policy libgtk-3-dev

  ibgtk-3-dev: Installed: (none) Candidate: 3.16.7-0ubuntu3 Version table: 3.16.7-0ubuntu3 0 500 http://in.archive.ubuntu.com/ubuntu/ wily/main i386 Packages 

apt-cache policy libgdk-pixbuf2.0-dev

  libgdk-pixbuf2.0-dev: Installed: (none) Candidate: 2.32.1-1 Version table: 2.32.1-1 0 500 http://in.archive.ubuntu.com/ubuntu/ wily/main i386 Packages 

apt-cache policy libpango1.0-dev

 libpango1.0-dev: Installed: (none) Candidate: 1.36.8-3 Version table: 1.36.8-3 0 500 http://in.archive.ubuntu.com/ubuntu/ wily/main i386 Packages 

apt-cache policy libcairo2-dev

 libcairo2-dev: Installed: (none) Candidate: 1.14.2-2ubuntu2 Version table: 1.14.2-2ubuntu2 0 500 http://in.archive.ubuntu.com/ubuntu/ wily/main i386 Packages 

sudo apt-get checksudo dpkg -C没有输出。
输出sudo apt-get update

 Reading package lists... Done Building dependency tree Reading state information... Done Hit http://ppa.launchpad.net wily InRelease Hit http://ppa.launchpad.net wily InRelease Hit http://ppa.launchpad.net wily/main i386 Packages Hit http://in.archive.ubuntu.com wily InRelease Hit http://ppa.launchpad.net wily/main Translation-en Hit http://ppa.launchpad.net wily/main i386 Packages Hit http://ppa.launchpad.net wily/main Translation-en Hit http://in.archive.ubuntu.com wily/main i386 Packages Hit http://in.archive.ubuntu.com wily/universe i386 Packages Hit http://in.archive.ubuntu.com wily/restricted i386 Packages Hit http://in.archive.ubuntu.com wily/multiverse i386 Packages Hit http://in.archive.ubuntu.com wily/main Translation-en Hit http://in.archive.ubuntu.com wily/multiverse Translation-en Hit http://in.archive.ubuntu.com wily/restricted Translation-en Hit http://in.archive.ubuntu.com wily/universe Translation-en Reading package lists... Done 

cat /etc/apt/sources.list输出

 deb http://in.archive.ubuntu.com/ubuntu/ wily main universe restricted multiverse 

编辑:我认为libpng12-0导致问题尝试使用apt-get安装libpng12-dev但是出现了这个错误

 The following packages have unmet dependencies: libpng12-dev : Depends: libpng12-0 (= 1.2.51-0ubuntu3) but 1.2.51-0ubuntu3.15.10.2 is to be installed 

尝试从源安装最新版本的libpng12-0,但仍然显示相同的错误。

EDIT2(Sollution?):没有做任何事情只是使用aptitude安装了libgtk-3-dev并接受了降级libpng12-0的解决方案

这不是现有破坏的依赖项( apt-get install -f会尝试修复)的情况,而是它无法获得安装新软件包所需的软件包。

这可能由于以下几个原因而发生:

  • 您有一个活动的存储库,它建议更新版本的libgtk-3-dev (或其直接依赖项),它不包含其他依赖项的正确版本。

    对于安装大量PPA的人来说,这可能是一个常见问题。 有些版本受到如此严重的影响,以至于依赖关系无法充分解决。

  • 您没有启用正确的依赖项(可能是Universe中的某些内容?)
  • 您最近没有运行apt-get update
  • 这是libgtk-3-dev (或其依赖项之一)中的一个直接错误。 在Launchpad上提交报告。

如果你只是编译东西,对这类问题的“快速”解决方法是启动一个干净的LXC(或其他)虚拟机。 这将让您重新启动而不会占用太多磁盘空间。