Debian 9.12 中的 libc6 依赖项不匹配

Debian 9.12 中的 libc6 依赖项不匹配

我在 Debian 9.12 Stretch 中遇到以下 libc6 依赖问题。

sudo apt install libc6-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:
 libc6-dev : Depends: libc6 (= 2.24-11+deb9u4) but 2.27-6 is to be installed
             Depends: libc-dev-bin (= 2.24-11+deb9u4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我该如何修复它?

编辑1:apt策略libc6

libc6:
  Installed: 2.27-6
  Candidate: 2.27-6
  Version table:
 *** 2.27-6 100
        100 /var/lib/dpkg/status
     2.24-11+deb9u4 500
        500 http://deb.debian.org/debian stretch/main amd64 Packages
     2.24-11+deb9u1 500
        500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages

编辑2:

sudo apt install libc6/stable libc6-bin/stable locales/stable
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Release 'stable' for 'libc6' was not found
E: Unable to locate package libc6-bin
E: Release 'stable' for 'locales' was not found

答案1

您系统上当前的版本libc6比 Debian 9 中的版本新,这会阻止您安装libc6-dev(必须与 的版本匹配libc6)。要安装libc6-dev,您必须降级libc6及相关软件包:

sudo apt install libc6/stretch libc-bin/stretch locales/stretch

这可能还需要降级其他软件包。

完成所有操作后,您就可以安装了libc6-dev

答案2

最后我在另一个论坛得到了帮助: https://serverfault.com/a/1004951/302842

这是降级有问题的软件包的解决方案:

apt install libc6/stretch libc6-dev/stretch libc-dev-bin/stretch libc-bin/stretch locales/stretch sudo/stretch

降级成功!

相关内容