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

  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


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

The version of libc6 currently on your system is newer than the version in Debian 9, and that prevents you from installing libc6-dev (which has to match the version of libc6). To install libc6-dev, you’ll have to downgrade libc6 and related packages:

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

This might require downgrading other packages too.

Once all that’s done, you’ll be able to install libc6-dev.

  • Debian 9 is oldstable instead of stable since last July. Feb 28 '20 at 23:26
  • Added EDIT2. Unfortunately not successful. See the errors.
    – klor
    Feb 28 '20 at 23:30

Finally I got help in another forum: https://serverfault.com/a/1004951/302842

This was the solution to downgrade the problematic packages:

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

The downgrade was successful!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.