Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

apt-get unable to correct Dependencies due to held packages

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
akka-vodol
Posts: 5
Joined: 2017-08-14 12:36

apt-get unable to correct Dependencies due to held packages

#1 Post by akka-vodol »

A short time ago I started running into issues with apt-get install. Sometimes, when I tried to install something, the install would fail and I would get an error message of the type :

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 aptitude : Depends: aptitude-common (= 0.8.7-1) but it is not going to be installed
            Depends: libcwidget3v5 but it is not going to be installed
            Recommends: libparse-debianchangelog-perl but it is not going to be installed
 code : Depends: libgconf-2-4 but it is not going to be installed
 libc-bin : Depends: libc6 (< 2.25) but 2.26-4 is to be installed
 locales : Depends: libc-bin (> 2.26) but 2.24-11+deb9u1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
I tried to run sudo apt --fix-broken install and I got this error:

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 code : Depends: libgconf-2-4 but it is not installed
 libc-bin : Depends: libc6 (< 2.25) but 2.26-4 is installed
 locales : Depends: libc-bin (> 2.26) but 2.24-11+deb9u1 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
I tried to run sudo dpkg --configure -a and I got this error :

Code: Select all

dpkg: dependency problems prevent processing triggers for libc-bin:
 libc-bin depends on libc6 (<< 2.25); however:
  Version of libc6:amd64 on system is 2.26-4.

dpkg: error processing package libc-bin (--configure):
 dependency problems - leaving triggers unprocessed
dpkg: dependency problems prevent configuration of code:
 code depends on libgconf-2-4; however:
  Package libgconf-2-4 is not installed.

dpkg: error processing package code (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of locales:
 locales depends on libc-bin (>> 2.26); however:
  Version of libc-bin on system is 2.24-11+deb9u1.

dpkg: error processing package locales (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libc-bin
 code
 locales
I seem to have an issue with the wrong version of libc6 being installed, but I don't know how to fix that (and I don't really know what I can do without breaking anything. removing the libc6 package seems like a bad idea).

Additional information :
My version of debian is stretch
There are two files in my /etc/sources.list.d/ directory, and their combined content is :

Code: Select all

deb http://deb.debian.org/debian/ stretch main
deb-src http://deb.debian.org/debian/ stretch main
deb http://ftp.fr.debian.org/debian/ stretch main non-free contrib
deb-src http://ftp.fr.debian.org/debian/ stretch main non-free contrib
#deb http://security.debian.org/debian-security stretch/updates main contrib non-fr$
#deb-src http://security.debian.org/debian-security stretch/updates main contrib no$
# stretch-updates, previously known as 'volatile'
deb http://ftp.fr.debian.org/debian/ stretch-updates main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ stretch-updates main contrib non-free
# deb http://ftp.de.debian.org/debian testing main
deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main
These commented repositories used to not be commented. I tried commenting them but it didn't fix the problem. I did install stuff using the testing repositories at some point, and it's possible that the problems started after that. (I don't remember for certain).

Fixing this issue is made even more difficult and annoying by the fact that I can't install some of the utilities which would fix my problem due to apt-get not working half the time. Even if I don't use apt-get, I've also run into this problem while installing something directly through dpkg. I hope you know how to fix it. thanks.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: apt-get unable to correct Dependencies due to held packa

#2 Post by GarryRicketson »

You mixed in "testing" with stable, when you used those testing sources.
Simply commenting them out will not change the damage done. You now have a mess, known as FrankenDebian.
https://wiki.debian.org/DontBreakDebian

You can try doing some searches, and maybe you can fix it.
I created a frankendebian, how can I clean it up and fix it
One hit that might help:
https://raphaelhertzog.com/2011/02/21/d ... tall-them/

If doing some reading and searches is to complicated for you , maybe a nanny will come along and hold your hand and help clean up the mess you made.
My kid did the same thing, I did not help him, he learned a lot from the experience, but finally did "clean it up", after reading some of the material I told him to read.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: apt-get unable to correct Dependencies due to held packa

#3 Post by bw123 »


I don't know how to fix that (and I don't really know what I can do without breaking anything. removing the libc6 package seems like a bad idea).
Without breaking anything? It's already broken. I would try to remove this 'code' package first, whatever it is.
resigned by AI ChatGPT

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: apt-get unable to correct Dependencies due to held packa

#4 Post by stevepusser »

Libc6 is the C runtime library. Literally just about the whole system needs it, especially the kernel.

Years ago I built a successful backported libc6 for Wheezy based MX 14 Linux, and worked out a recipe how to safely revert to the Wheezy versions from the backports. It's worth a try before a complete restore from your backups: https://forum.mxlinux.org/viewtopic.php ... 97#p349597
MX Linux packager and developer

Post Reply