无法在 Raspberry Pi 2 上安装 libgtk2.0-dev

Unable to install libgtk2.0-dev on Raspberry Pi 2

我正在尝试在我的 Raspberry Pi 2 运行 上安装 libgtk2.0-dev,最新 raspbian。当我使用命令 sudo apt-get install libgtk2.0-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:
 libgtk2.0-dev : Depends: libpango1.0-dev (>= 1.20) but it is not going to be installed
                 Depends: libcairo2-dev (>= 1.6.4-6.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我尝试使用 sudo apt-get install -fsudo apt-get updatesudo apt-get upgradesudo apt-get install libgtk2.0-dev 修复损坏的包。它仍然没有用。我在依赖项及其依赖项上尝试了 apt-get install,但结果是一样的。 link1 and link2 中的解决方案也没有帮助。

我的 source.list 包含:

deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb http://archive.raspbian.org/raspbian jessie main contrib non-free rpi

我的 source.list 是不是遗漏了什么?我该如何解决这个问题?

apt-cache policy libgtk2.0-dev libpango1.0-dev libcairo2-dev 表明问题出在 /etc/apt/sources.list.d/raspi.list.

raspi.list 包含 deb http://archive.raspberrypi.org/debian/ wheezy main。将 wheezy 更改为 jessie,运行 apt-get update 然后 运行 apt-get install libgtk2.0-dev 起作用了。

改用 aptitude:

sudo aptitude install libglib2.0-dev