依赖关系混乱

依赖关系混乱

我正在尝试libglib2.0-dev安装

brian@computer:~$ sudo apt-get install libglib2.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:
 libglib2.0-dev : Depends: libglib2.0-0 (= 2.48.0-1ubuntu4) but 2.48.1-1~ubuntu16.04.1 is to be installed
              Depends: libglib2.0-bin (= 2.48.0-1ubuntu4)
E: Unable to correct problems, you have held broken packages.

哦不!如果我尝试自己安装那些缺失的软件包会怎么样?

brian@computer:~$ sudo apt-get install libglib2.0-0 libglib2.0-bin

然后我得到:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
libglib2.0-0 is already the newest version (2.48.1-1~ubuntu16.04.1).
libglib2.0-bin is already the newest version (2.48.1-1~ubuntu16.04.1).
0 to upgrade, 0 to newly install, 0 to remove and 11 not to upgrade.

所以它们已经安装好了...现在该做什么?我确实看到与和之间存在一些差异2.48.0-1ubuntu4)2.48.1-1~ubuntu16.04.1但这是什么意思,我该如何消除它?

答案1

这可能是您正在使用的 Ubuntu 镜像的一个暂时性问题 - 它有新的 libglib2.0,但还没有相应的 -dev 包。尝试切换到其他镜像,或手动下载并安装它:

curl -O http://gb.archive.ubuntu.com/ubuntu/pool/main/g/glib2.0/libglib2.0-dev_2.48.1-1~ubuntu16.04.1_amd64.deb
dpkg -i libglib2.0-dev_2.48.1-1~ubuntu16.04.1_amd64.deb

相关内容