无法在 ubuntu 12.04 上安装 libgtk2.0-dev

rot*_*age 6 package-management apt dependencies opencv 12.04

我在 ubunut 12.04 上使用 opencv 3,在显示图像时,错误消息要求我使用 libgtk2.0-dev 构建库。我试过sudo apt-get install libgtk2.0-dev但我收到以下错误。

teraflops@teraflops-Inspiron-3542:~$ sudo apt-get install libgtk2.0-devReading 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.
teraflops@teraflops-Inspiron-3542:~$ 
Run Code Online (Sandbox Code Playgroud)

我几乎尝试了所有在线解决方案,如此处 1此处 2,但都没有结果。请建议我解决问题的任何方法。我曾尝试分别安装libpango1-devlibcairo2-dev ,但两者都破坏了导致libfontconfig1-dev 的依赖关系。尝试安装后者给出

teraflops@teraflops-Inspiron-3542:~$ sudo apt-get install libfontconfig1-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:
 libfontconfig1-dev : Depends: libfontconfig1 (= 2.8.0-3ubuntu9.1) but 2.10.1-0ubuntu3 is to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)

任何类型的建议/解决方案都是最受欢迎的

dou*_*oug 1

很简单的问题——

libfontconfig1-dev : Depends: libfontconfig1 (= 2.8.0-3ubuntu9.1) but 2.10.1-0ubuntu3 is to be installed

您安装了 12.10 版本的 libfontconfig1 2.10.1-0ubuntu3,但版本为 12.04。因此,您需要将该软件包替换为 12.04 版本以及您安装的任何其他可能导致冲突的 12.10 软件包。祝你好运...

apt-cache policy libfontconfig1& 或者apt-cache madison libfontconfig1应该清楚地表明这一点