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

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.


You can use this sequence of commands (up to 3) to force a re-download of the partial files of the offending packages. Remaining steps are done to merge the new files with the old one, to avoid warnings and issues on non-offending packages that do not get downloaded in this attempt.

  1. sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_old
  2. sudo mkdir /var/lib/dpkg/info
  3. sudo apt-get update && sudo apt-get -f install
  4. sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old
  5. sudo rm -rf /var/lib/dpkg/info 
  6. sudo mv /var/lib/dpkg/info_old /var/lib/dpkg/info