我正在尝试在运行最新 raspbian 的 Raspberry Pi 2 上安装 libgtk2.0-dev。当我使用命令 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 -f
、sudo apt-get update
、sudo apt-get upgrade
修复损坏的包然后 sudo apt-get install libgtk2.0-dev
。它仍然没有用。我在依赖项及其依赖项上尝试了 apt-get install,但结果是一样的。 link1中的解决方案和 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
成功了。
关于linux - 无法在 Raspberry Pi 2 上安装 libgtk2.0-dev,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33280656/