大网数据广告活动
服务器运维问答

libc6 dependency mismatch in Debian 9.12 stretch

· 52CE 我爱测

I have the following libc6 dependency problem in Debian 9.12 stretch. sudo apt install libc6-dev Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This …

问题原文

原帖链接 · klor · CC BY-SA 4.0

I have the following libc6 dependency problem in Debian 9.12 stretch.

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.

How can I fix it?

EDIT1: apt policy 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

EDIT2:

apt install libc6/stretch libc6-dev/stretch libc-dev-bin/stretch
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '2.24-11+deb9u4' (Debian:9.12/oldstable [amd64]) for 'libc6'
Selected version '2.24-11+deb9u4' (Debian:9.12/oldstable [amd64]) for 'libc6-dev'
Selected version '2.24-11+deb9u4' (Debian:9.12/oldstable [amd64]) for 'libc-dev-bin'
The following additional packages will be installed:
linux-libc-dev
Suggested packages:
glibc-doc locales
The following packages will be REMOVED:
libc-bin locales sudo
The following NEW packages will be installed:
libc-dev-bin libc6-dev linux-libc-dev
The following packages will be DOWNGRADED:
libc6
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
libc-bin
0 upgraded, 3 newly installed, 1 downgraded, 3 to remove and 0 not upgraded.
Need to get 6,797 kB of archives.
After this operation, 1,437 kB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
?]

已采纳解答

原帖链接 · Piotr P. Karwasz · CC BY-SA 4.0

You configured your system to use packages from several distributions at once (a so-called Frankenstein-Debian), so dependency errors are normal. Run cat /etc/apt/sources.list{,.d/*.list} in bash to list all sources.

Your libc6 (version 2.27-6) is stuck somewhere between stretch (version 2.24-11+deb9u4) and buster (version 2.28-10). My guess is you pulled some packages from buster, while it was still the testing distribution. The easiest way to solve this problem is:

  1. Find in your APT sources a reference to testing or buster. If you find something like:

    deb http://deb.debian.org/debian testing main non-free contrib
    

    replace it with:

    deb http://deb.debian.org/debian buster main non-free contrib
    

    since buster isn't the testing distribution any more (bullseye is).

  2. Update the list of packages:

    apt update
    
  3. Upgrade your libc6 to the version from buster:

    apt install libc6/buster libc6-dev/buster libc-dev-bin/buster
    
  4. Consider upgrading to Debian 10 in the near future to have all packages from the same distribution.

Edit: It seems you have few packages with a version higher than Stretch, so you can just downgrade them:

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

and remove buster and company from APT sources.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-02-27)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。