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

时间:2015-10-22 12:07:13

标签: linux raspbian raspberry-pi2

我正在尝试在最新的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 -fsudo apt-get updatesudo apt-get upgradesudo apt-get install libgtk2.0-dev来修复损坏的软件包。它仍然无法正常工作。我在依赖项及其依赖项上尝试了apt-get install,但结果是一样的。 link1link2中的解决方案也无济于事。

我的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中遗漏了什么?我该如何解决这个问题?

2 个答案:

答案 0 :(得分:1)

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

答案 1 :(得分:0)

改用aptitude:

sudo aptitude install libglib2.0-dev