apt-get unable to correct Dependencies due to held packages

Kernels & Hardware, configuring network, installing services

apt-get unable to correct Dependencies due to held packages

Postby akka-vodol » 2018-02-27 17:15

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.
akka-vodol
 
Posts: 5
Joined: 2017-08-14 12:36

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

Postby GarryRicketson » 2018-02-27 17:26

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/debian-cleanup-tip-4-find-broken-packages-and-reinstall-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
GarryRicketson
 
Posts: 4817
Joined: 2015-01-20 22:16
Location: Durango, Mexico

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

Postby bw123 » 2018-02-27 17:53


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.
User avatar
bw123
 
Posts: 3085
Joined: 2011-05-09 06:02
Location: TN_USA

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

Postby stevepusser » 2018-02-27 19:50

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
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: GIMP 2.10.2, Pale Moon 27.9.3, wine-staging 3.10, QuiteRSS 0.18.11, Linux kernel 4.17, Krita 4.0.4
User avatar
stevepusser
 
Posts: 9648
Joined: 2009-10-06 05:53


Return to System configuration

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable