How to solve this seemingly impossible dependency problem?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to solve this seemingly impossible dependency problem?
I cannot install any new packages using apt. When I try to install anything I get error like this,
Code:
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libstdc++6 : Depends: gcc-5-base (= 5.4.0-6ubuntu1~16.04.4) but it is not installable
Breaks: fceux (<= 2.2.2+dfsg0-1) but 2.2.1+dfsg0-2 is to be installed
Breaks: libstdc++6:i386 (!= 5.4.0-6ubuntu1~16.04.4) but 6.2.0-3ubuntu11~14.04 is to be installed
libstdc++6:i386 : Breaks: libstdc++6 (!= 6.2.0-3ubuntu11~14.04) but 5.4.0-6ubuntu1~16.04.4 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Now when I run
Code:
sudo apt-get install -f
I get this error,
Code:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
libstdc++6 : Depends: gcc-5-base (= 5.4.0-6ubuntu1~16.04.4) but it is not installable
Breaks: fceux (<= 2.2.2+dfsg0-1) but 2.2.1+dfsg0-2 is installed
Breaks: libstdc++6:i386 (!= 5.4.0-6ubuntu1~16.04.4) but 6.2.0-3ubuntu11~14.04 is installed
libstdc++6:i386 : Breaks: libstdc++6 (!= 6.2.0-3ubuntu11~14.04) but 5.4.0-6ubuntu1~16.04.4 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
When I try to see any held packages with
Code:
sudo apt-mark showhold
The terminal spits out nothing. I thought that probably libstdc++6 is being held, so tried to unhold it using
Code:
sudo apt-mark unhold libstdc++6
It seems like it wasn't held. The output was,
Code:
libstdc++6 was already not hold.
When I try to sudo apt-get autoremove, I get this extra error along with the ones above,
Code:
W: Ignoring Provides line with DepCompareOp for package libreoffice-l10n
And I have tried the following commands with no result at all,
Code:
sudo apt-get clean
sudo apt-get autoclean
sudo dpkg --configure -a
This whole thing started when I tried to install libstdc++6 from Ubuntu's higher (than the version that I am running) version repository. I have forced to dpkg to to remove it and probably that put me deeper in the quicksand. Now, I have run out of my bag of tricks here. Please help.
Do you have a recent backed up/imaged copy of your system that you can revert to? That would be my first choice if faced with this scenario.
In general, so much of the system is dependent on the correct versions of packages like libstdc++ that it's best to leave these well alone. If not, you should definitely back up your system before playing about with them.
If you don't have a system backup to which you can revert, the first thing I would suggest is that you look closely at /var/log/apt/history.log and term.log to see exactly which commands you have issued and which packages have been added/removed since you tried installing libstdc++6 from the "higher version" repository.
You will need to tell us about this "higher version" repository. Generally, you should not install packages from any repository that represents a different system version to the one you're using - it often leads to trouble, particularly if you're talking about system libraries.
--configure package...|-a|--pending
Configure a package which has been unpacked but not yet config‐
ured. If -a or --pending is given instead of package, all
unpacked but unconfigured packages are configured.
Configuring consists of the following steps:
1. Unpack the conffiles, and at the same time back up the old
conffiles, so that they can be restored if something goes wrong.
2. Run postinst script, if provided by the package.
From man dpkg-reconfigure
Code:
dpkg-reconfigure - reconfigure an already installed package
-pvalue, --priority=value
Specify the minimum priority of question that will be displayed.
dpkg-reconfigure normally shows low priority questions no matter
what your default priority is. See debconf(7) for a list.
-a, --all
Reconfigure all installed packages that use debconf. Warning: this
may take a long time.
What's your sources.list & sources.list.d look like? One thing I have recently done when I upgraded some packages to experimental is create a /etc/apt/preferences.d/<whatever> file and set the system priority to 1100 for the regular package. This high a priority will actually allow apt to DOWNGRADE packages if it's required in order to install the target software.
Do you have a recent backed up/imaged copy of your system that you can revert to?
Unfortunately, I don't have a backup.
Quote:
You will need to tell us about this "higher version" repository.
I am on Ubuntu 14.04 LTS with support till 2019. But I downloaded the package from Ubuntu 16.04 LTS repository.
Quote:
If you don't have a system backup to which you can revert, the first thing I would suggest is that you look closely at /var/log/apt/history.log and term.log to see exactly which commands you have issued and which packages have been added/removed since you tried installing libstdc++6 from the "higher version" repository.
I will look at the log history but as apt and dpkg complain, the problem is with libstdc++6 package and there is nothing I can do about it. I cannot install, remove or reinstall any packages due to dependency problem in the way. I think I have completely broken my packages system.
I am on Ubuntu 14.04 LTS with support till 2019. But I downloaded the package from Ubuntu 16.04 LTS repository.
I will look at the log history but as apt and dpkg complain, the problem is with libstdc++6 package and there is nothing I can do about it. I cannot install, remove or reinstall any packages due to dependency problem in the way. I think I have completely broken my packages system.
Not necessarily. You can place packages which may cause dependency problems on hold and concentrate on addressing individual packages one at a time. First, though, you should paste the relevant tail of history.log here so that we can what you've done since (and including) you updated libstdc++6.
Also, as noted by another poster, list your current repos here (if you have inxi installed, inxi -r provides a handy of listing of these).
What's your sources.list & sources.list.d look like? One thing I have recently done when I upgraded some packages to experimental is create a /etc/apt/preferences.d/<whatever> file and set the system priority to 1100 for the regular package. This high a priority will actually allow apt to DOWNGRADE packages if it's required in order to install the target software.
Code:
deb http://in.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb http://archive.canonical.com/ubuntu trusty partner
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main
deb [arch=amd64] https://s3-us-west-2.amazonaws.com/brave-apt trusty main
Here is my /etc/apt/sources.list without the comments.
Quote:
Originally Posted by TheEzekielProject
Have you tried
Code:
dpkg-reconfigure -a
? Note that this is different than
Code:
dpkg --configure -a
This code throws an error that looks like this,
Code:
/usr/sbin/dpkg-reconfigure: ca-certificates is broken or not fully installed
Quote:
Originally Posted by hydrurga
Not necessarily. You can place packages which may cause dependency problems on hold and concentrate on addressing individual packages one at a time. First, though, you should paste the relevant tail of history.log here so that we can what you've done since (and including) you updated libstdc++6.
Also, as noted by another poster, list your current repos here (if you have inxi installed, inxi -r provides a handy of listing of these).
Here is the relevant (I think) /var/log/apt/history.log
God. I am in a heap of trouble now. I force purged the certificates, reconfigured dpkg and now when I run apt-get install -f, I get more dependency problem than I began with,
Code:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
ca-certificates-java : Depends: ca-certificates (>= 20121114) but it is not installed
liblwp-protocol-https-perl : Depends: ca-certificates but it is not installed
libruby1.9.1 : Depends: ca-certificates but it is not installed
libstdc++6 : Depends: gcc-5-base (= 5.4.0-6ubuntu1~16.04.4) but it is not installable
Breaks: fceux (<= 2.2.2+dfsg0-1) but 2.2.1+dfsg0-2 is installed
Breaks: libstdc++6:i386 (!= 5.4.0-6ubuntu1~16.04.4) but 6.2.0-3ubuntu11~14.04 is installed
libstdc++6:i386 : Breaks: libstdc++6 (!= 6.2.0-3ubuntu11~14.04) but 5.4.0-6ubuntu1~16.04.4 is installed
libwww-perl : Depends: ca-certificates but it is not installed
python-httplib2 : Depends: ca-certificates but it is not installed
python-pip : Depends: ca-certificates but it is not installed
Recommends: python-dev-all (>= 2.6) but it is not installable
python-requests : Depends: ca-certificates but it is not installed
python-requests-whl : Depends: ca-certificates but it is not installed
python3-httplib2 : Depends: ca-certificates but it is not installed
python3-pip : Depends: ca-certificates but it is not installed
python3-requests : Depends: ca-certificates but it is not installed
software-properties-common : Depends: ca-certificates but it is not installed
ubuntu-desktop : Depends: ca-certificates but it is not installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
Try to apt install ca-certificates without any other packages. And I would temporarily edit your apt.sources to only include Ubuntu official repositories for the moment
God. I am in a heap of trouble now. I force purged the certificates, reconfigured dpkg and now when I run apt-get install -f, I get more dependency problem than I began with,
That's because dpkg --purge removed both the ca-certificates package and its config files, not just the latter.
apt-get download ca-certificates will download the deb to the folder where you run the command, and then you can try installing the deb by dpkg -i or double-clicking on it. That's assuming that its dependencies are met - if not, you will have to download those as well.
I would try setting up pinning with priority >1000 like I had suggested and install with a target (-t repo). This allows apt to downgrade packages installed from newer repos to the version in the target. I have used it successfully several times to fix exactly this. It's not 100% successful, but it's very good.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.