5

After I interrupt an upgrade, a lot of depending problems and broken packages appears. Here are my code,

sudo apt-get install -f
[sudo] password for user: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 137 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
dpkg: error processing package libc6:amd64 (--configure):
 package libc6:amd64 2.21-0ubuntu4.1 cannot be configured because libc6:i386 is at a different version (2.21-0ubuntu4)
dpkg: dependency problems prevent configuration of libc-dev-bin:
 libc-dev-bin depends on libc6 (>> 2.21); however:
  Package libc6:amd64 is not configured yet.
 libc-dev-bin depends on libc6 (<< 2.22); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package libc-dev-bin (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libc6-dev:amd64:
 libc6-dev:amd64 depends on libc6 (= 2.21-0ubuntu4.1); however:
  Package libc6:amd64 is not configured yet.
 libc6-dev:amd64 depends on libc-dev-bin (= 2.21-0ubuntu4.1); however:
  Package libc-dev-bin is not configured yet.

dpkg: error processing package libc6-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libc6-dbg:amd64:
 libc6-dbg:amd64 depends on libc6 (= 2.21-0ubuntu4.1); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package libc6-dbg:amd64 (--configure):
 No apport report written because the error message indicates its a followup error from a previous failure.
                           No apport report written because the error message indicates its a followup error from a previous failure.
                                                     No apport report written because MaxReports is reached already
                                   dependency problems - leaving unconfigured
Errors were encountered while processing:
 libc6:amd64
 libc-dev-bin
 libc6-dev:amd64
 libc6-dbg:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

There is something else may be useful.

sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of libc6-dbg:amd64:
 libc6-dbg:amd64 depends on libc6 (= 2.21-0ubuntu4.1); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package libc6-dbg:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: error processing package libc6:i386 (--configure):
 package libc6:i386 2.21-0ubuntu4 cannot be configured because libc6:amd64 is at a different version (2.21-0ubuntu4.1)
Errors were encountered while processing:
 libc6-dbg:amd64
 libc6:i386

I found this code,but seems no use

sudo apt-get -f dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  fonts-stix libappindicator1 libindicator7 libqt5x11extras5
  linux-headers-4.2.0-34 linux-headers-4.2.0-34-generic
  linux-image-4.2.0-34-generic linux-image-extra-4.2.0-34-generic
The following packages will be upgraded:
  bind9-host ca-certificates chromium-browser chromium-browser-l10n
  chromium-codecs-ffmpeg-extra cpio dnsutils eog firefox-locale-en
  firefox-locale-zh-hans flashplugin-installer fonts-opensymbol
  gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0
  gir1.2-javascriptcoregtk-3.0 gir1.2-webkit-3.0 git git-man glib-networking
  glib-networking-common glib-networking-services gstreamer1.0-alsa
  gstreamer1.0-libav gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps
  gstreamer1.0-plugins-good gstreamer1.0-pulseaudio gstreamer1.0-tools
  gstreamer1.0-x ifupdown libbind9-90 libdns-export100 libdns100
  libgail-common libgail18 libgcrypt20 libglib2.0-0 libglib2.0-bin
  libglib2.0-data libgraphite2-3 libgstreamer-plugins-base1.0-0
  libgstreamer-plugins-good1.0-0 libgstreamer1.0-0 libgtk2.0-0 libgtk2.0-bin
  libgtk2.0-common libhogweed4 libirs-export91 libisc-export95 libisc95
  libisccc90 libisccfg-export90 libisccfg90 libjasper1
  libjavascriptcoregtk-3.0-0 liblwres90 libnettle6 libnm-glib-vpn1 libnm-glib4
  libnm-util2 libnm0 libnss3 libnss3-nssdb libnuma1 libpam-modules
  libpam-modules-bin libpam-runtime libpam-systemd libpam0g libperl5.20
  libpurple-bin libpurple0 libreoffice-avmedia-backend-gstreamer
  libreoffice-base-core libreoffice-calc libreoffice-common libreoffice-core
  libreoffice-draw libreoffice-gnome libreoffice-gtk libreoffice-help-en-gb
  libreoffice-help-en-us libreoffice-help-zh-cn libreoffice-impress
  libreoffice-l10n-en-gb libreoffice-l10n-en-za libreoffice-l10n-zh-cn
  libreoffice-math libreoffice-ogltrans libreoffice-pdfimport
  libreoffice-style-galaxy libreoffice-style-human libreoffice-writer
  libsmbclient libssh-4 libssh-gcrypt-4 libssl1.0.0 libsystemd0 libtiff5
  libudev1 libwbclient0 libwebkitgtk-3.0-0 libwebkitgtk-3.0-common
  linux-generic linux-headers-generic linux-image-generic multiarch-support
  network-manager openssl perl perl-base perl-modules python-samba
  python3-distupgrade python3-uno samba-common samba-common-bin samba-libs
  simple-scan systemd systemd-sysv thunderbird thunderbird-gnome-support
  thunderbird-locale-en thunderbird-locale-en-gb thunderbird-locale-en-us
  thunderbird-locale-zh-cn thunderbird-locale-zh-hans tzdata
  ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk udev uno-libs3
  update-notifier update-notifier-common ure zeal
137 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
Need to get 0 B/313 MB of archives.
After this operation, 318 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Extracting templates from packages: 100%
Preconfiguring packages ...
dpkg: error processing package libc6:amd64 (--configure):
 package libc6:amd64 2.21-0ubuntu4.1 cannot be configured because libc6:i386 is at a different version (2.21-0ubuntu4)
Errors were encountered while processing:
 libc6:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

Help guys,Please!Do I need reinstall dpkg?

3 Answers 3

0

First!! backup everything you can!

I have had this in the past and lost the install completely.

Then try removing the trouble package:

 sudo apt-get remove --purge libc6

If that is successful, retry:

 sudo apt-get -f dist-upgrade
4
  • I am sorry to say that it seems that Ubuntu only backup the /home for me.But I have tried to remove libc6, it warned me it is very dangerous to do so.What is this package used for?Will it really cause problems?
    – Page David
    Mar 26, 2016 at 13:33
  • No - it's as if it's got "confused". All purging it will do isl clean up the mess - any app/package that needs it will reinstall it.
    – Zogg
    Apr 1, 2016 at 16:59
  • I still get this error after remove libc6:Unpacking libgcc1:amd64 (1:5.2.1-22ubuntu2) ... dpkg: error processing package libc6:amd64 (--configure): package libc6:amd64 2.21-0ubuntu4.1 cannot be configured because libc6:i386 is at a different version (2.21-0ubuntu4) Setting up libgcc1:amd64 (1:5.2.1-22ubuntu2) ... Errors were encountered while processing: libc6:amd64 E: Sub-process /usr/bin/dpkg returned an error code (1)
    – Page David
    Apr 2, 2016 at 8:45
  • I gived up and reinstall ubuntu...Thanks for your help anyway
    – Page David
    Apr 2, 2016 at 11:01
4

It might help to just install all packages from the cache:

sudo dpkg -i /var/cache/apt/archives/*deb

Credits: Question on askubuntu.com

3
  • Sorry, but I have reinstalled the OS...so, I'm not sure if it works.
    – Page David
    Jun 2, 2016 at 12:29
  • won't work in that case, since the cache folder contains a mixture of old and new packages.
    – bebbo
    Apr 30, 2020 at 7:10
  • You are life saver :) Jun 9 at 1:56
0

I could repair my broken upgrade process by reinstalling dpkg.

Naive first attempt:

sudo dpkg -i /var/cache/apt/archives/dpkg_1.19.7ubuntu3_amd64.deb
(Reading database ... 65377 files and directories currently installed.)
Preparing to unpack .../dpkg_1.19.7ubuntu3_amd64.deb ...
Unpacking dpkg (1.19.7ubuntu3) over (1.19.7ubuntu3) ...
dpkg: dependency problems prevent configuration of dpkg:
 dpkg depends on libbz2-1.0; however:
  Package libbz2-1.0:amd64 is not configured yet.
 dpkg depends on libselinux1 (>= 2.3); however:
  Package libselinux1:amd64 is not configured yet.
 dpkg depends on libzstd1 (>= 1.3.2); however:
  Package libzstd1:amd64 is not configured yet.
 dpkg depends on zlib1g (>= 1:1.1.4); however:
  Package zlib1g:amd64 is not configured yet.
 dpkg depends on tar (>= 1.28-1); however:
  Package tar is not configured yet.

Repeat the manual installation attempt for each dependency recursively. Start with libselinux:

sudo dpkg -i /var/cache/apt/archives/libselinux1_3.0-1build2_amd64.deb
(Reading database ... 65377 files and directories currently installed.)
Preparing to unpack .../libselinux1_3.0-1build2_amd64.deb ...
Unpacking libselinux1:amd64 (3.0-1build2) over (3.0-1build2) ...
dpkg: dependency problems prevent configuration of libselinux1:amd64:
 libselinux1:amd64 depends on libpcre2-8-0 (>= 10.22); however:
  Package libpcre2-8-0:amd64 is not configured yet.

ok, start with libpcre2-8-0...

sudo dpkg -i /var/cache/apt/archives/libpcre2-8-0_10.34-7_amd64.deb
(Reading database ... 65377 files and directories currently installed.)
Preparing to unpack .../libpcre2-8-0_10.34-7_amd64.deb ...
Unpacking libpcre2-8-0:amd64 (10.34-7) over (10.34-7) ...
Setting up libpcre2-8-0:amd64 (10.34-7) ...

success! now install libselinux again. then the other libs, tar and finally dpkg.

... [omitted]

sudo dpkg -i /var/cache/apt/archives/dpkg_1.19.7ubuntu3_amd64.deb
(Reading database ... 65377 files and directories currently installed.)
Preparing to unpack .../dpkg_1.19.7ubuntu3_amd64.deb ...
Unpacking dpkg (1.19.7ubuntu3) over (1.19.7ubuntu3) ...
Setting up dpkg (1.19.7ubuntu3) ...

Yay, successfully reinstalled dpkg. Once dpkg is recent again, run

sudo apt --fix-broken install

That should work now and finish your installation.

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.