Stuck with apt --fix-broken install (libc6:amd64 package post-installation)

Adam Mierzwiak picture Adam Mierzwiak · Mar 31, 2020 · Viewed 16.9k times · Source

My system runs inside WSL, I upgrade it at least every few days. I stuck with one package installation, and looking for a way to solve this:

$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libbind9-161 libdns-export1107 libdns1107 libdns1109 libirs161 libisc-export1104 libisc1104 libisc1105 libisccc161
  libisccfg163 liblwres161 liboauth0
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libc-bin
The following packages will be upgraded:
  libc-bin
1 upgraded, 0 newly installed, 0 to remove and 882 not upgraded.
6 not fully installed or removed.
Need to get 0 B/633 kB of archives.
After this operation, 8,192 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up libc6:amd64 (2.31-0ubuntu6) ...
Checking for services that may need to be restarted...
Checking init scripts...
Nothing to restart.
sleep: cannot read realtime clock: Invalid argument
dpkg: error processing package libc6:amd64 (--configure):
 installed libc6:amd64 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 libc6:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

What can I try next?

Answer

Martijn picture Martijn · May 9, 2020

I ran into the same problem, and this procedure from this bug report fixed it:

Edit /var/lib/dpkg/info/libc6\:amd64.postinst

and comment out the line

# set -e

so $ apt-get -f install can continue.