I recently descended into endlessly broken apt and dpkg hell. Usually this is enough to get out of the woods:
sudo dpkg --configure -a
sudo apt-get -f install
but not this time. I also tried cleaning out the cache and re-downloading the packages, but no dice. Until this is fixed you can't install or remove any other packages. Here's a few things I tried and the errors I was getting:
$ sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of libc6-dev:
libc6-dev depends on libc6 (= 2.15-0ubuntu10.2); however:
Version of libc6 on system is 2.15-0ubuntu10.3.
libc6-dev depends on libc-dev-bin (= 2.15-0ubuntu10.2); however:
Version of libc-dev-bin on system is 2.15-0ubuntu10.3.
dpkg: error processing libc6-dev (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
libc6-dev
$ sudo dpkg -r libc6-dev
dpkg: dependency problems prevent removal of libc6-dev:
libgnutls-dev depends on libc6-dev | libc-dev; however:
Package libc6-dev is to be removed.
Package libc-dev is not installed.
Package libc6-dev which provides libc-dev is to be removed.
[snip]
libgcrypt11-dev depends on libc6-dev | libc-dev; however:
Package libc6-dev is to be removed.
Package libc-dev is not installed.
Package libc6-dev which provides libc-dev is to be removed.
dpkg: error processing libc6-dev (--remove):
dependency problems - not removing
Errors were encountered while processing:
libc6-dev
$ sudo apt-get remove libc-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libc6-dev' instead of 'libc-dev'
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libc6-dev : Depends: libc6 (= 2.15-0ubuntu10.2) but 2.15-0ubuntu10.3 is to be installed
Depends: libc-dev-bin (= 2.15-0ubuntu10.2) but 2.15-0ubuntu10.3 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
$ sudo apt-get -f 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:
libutouch-grail1 libutouch-evemu1 libutouch-frame1 libutouch-geis1
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libc6-dev
Suggested packages:
glibc-doc
The following packages will be upgraded:
libc6-dev
1 upgraded, 0 newly installed, 0 to remove and 156 not upgraded.
1 not fully installed or removed.
Need to get 0 B/5,100 kB of archives.
After this operation, 2,048 B disk space will be freed.
Do you want to continue [Y/n]?
dpkg: dependency problems prevent configuration of libc6-dev:
libc6-dev depends on libc6 (= 2.15-0ubuntu10.2); however:
Version of libc6 on system is 2.15-0ubuntu10.3.
libc6-dev depends on libc-dev-bin (= 2.15-0ubuntu10.2); however:
Version of libc-dev-bin on system is 2.15-0ubuntu10.3.
dpkg: error processing libc6-dev (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
libc6-dev
E: Sub-process /usr/bin/dpkg returned an error code (1)
The solution was to put the offending package on hold (run as root):
# echo "libc6-dev hold" | dpkg --set-selections
then run:
# apt-get -f install
which removed a bunch of packages, including the offending broken one. I could then apt-get update and upgrade as normal. Hooray!
11 comments:
I encountered the same but the fix did not help. Not sure I did it correctly (i'm a command-line novice). Could you expand a bit on the dev hold and --set-selections parts a bit more? Would really appreciate it.
Thanks!! Saved my day =)
Save my day also!
awesome dude, you saved my night, now I can sleep at peace.
Wow, after search all over internet this solution was the one that worked!
THX
Thanks, you saved me
Thanks :)
Nice help.
Please make this correction in your command :
echo "libc6-dev hold" | sudo dpkg --set-selections
Thanks, mate.You Saved my day :)
Sos un Groso papa!! me salvaste el día!! saludos desde sudamerica!!
Thanks bro. Works perfect !
Post a Comment