Debian: libc6:i386 is at a different version

I got an error when installing gdb on my Linux laptop running Debian unstable:

$ LC_ALL=C apt install gdb
[...]
dpkg: error processing package libc6:amd64 (--configure):
 package libc6:amd64 2.38-14 cannot be configured because libc6:i386 is at a different version (2.37-19)
Errors were encountered while processing:
 libc6:amd64

It suggested to run a command to fix it automatically, but that failed with the exact same error:

$ LC_ALL=C apt --fix-broken install  -y
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  arch-test cgroupfs-mount criu debootstrap libmodule-find-perl libmodule-scandeps-perl libnet1 needrestart runc systemd-dev tini
Use 'apt autoremove' to remove them.
 
Upgrading:
  libc-bin libc6:i386 libnss-systemd libpam-systemd libsystemd0 libsystemd0:i386 libudev-dev libudev1 libudev1:i386 systemd udev
 
Installing dependencies:
  linux-sysctl-defaults systemd-cryptsetup
 
Summary:
  Upgrading: 11, Installing: 2, Removing: 0, Not Upgrading: 1615
  10 not fully installed or removed.
  Download size: 0 B / 10.4 MB
  Space needed: 1141 kB / 5175 MB available
 
apt-listchanges: Reading changelogs...
Preconfiguring packages ...
dpkg: error processing package libc6:amd64 (--configure):
 package libc6:amd64 2.38-14 cannot be configured because libc6:i386 is at a different version (2.37-19)
Errors were encountered while processing:
 libc6:amd64
Error: Timeout was reached
needrestart is being skipped since dpkg has failed
Error: Sub-process /usr/bin/dpkg returned an error code (1)

The problem is that libc6:amd64 is installed in a different version than its i386 counterpart (although libc6:i386 is available in the same version, as I confirmed via apt show libc6:i386). Since the preconfiguration already fails, it will never reach the stage where it can update the i386 version to the same that amd64 has.

The solution was to circumvent all the configuration automatisms that apt uses and manually install the correct libc6:i386 version:

$ apt download libc6:i386
$ dpkg -i libc6_2.38-14_i386.deb
$ LC_ALL=C apt --fix-broken install -y

After that apt behaved properly again.

Written by Christian Weiske.

Comments? Please send an e-mail.