libc6 dependency mismatch in Debian 9.12 stretch

Solution 1:

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.