7

I'm running ubuntu 14.04. I cannot use software center to install anything, even a local deb package so I have to rely on Terminal.

Recently I was trying to install mysql-server which generated error which I could pin-point was the required version of libstdc++6 . My system had 4.8.x while mysql 5.6 required >=4.9. Trying the usual upgrading process and unsuccessful, I consulted my sys admin, who tried installing the 4.9 package manually(using a local .deb package), which failed as well citing unmet dependencies.

At present, what I have is a system with error saying no new software can be installed.

The sudo apt-get install -f gives following output:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 libstdc++6 : Depends: gcc-4.9-base (= 4.9.2-10) but 4.9.1-0ubuntu1 is installed
 libstdc++6:i386 : Depends: gcc-4.9-base:i386 (= 4.9.2-10) but 4.9.1-0ubuntu1 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

I checked for held packages using

dpkg -l | grep ^h
dpkg -l | grep hold

Result: nothing.

Also tried to find the broken package, if any but the file /var/log/dist-upgrade/apt.log doesn't exist.

So, what should/can I do now.

2
  • Where are you installing mysql-server from? An external repository, or Ubuntu's repositories? – zhongfu Apr 17 '15 at 8:12
  • I used mysql apt repository from link. – neo.one Apr 17 '15 at 9:00
2

Your unmet dependencies problem is caused by the MySQL APT Repository repository. MySQL Server 5.6 from the MySQL APT Repository requires libstdc++6 >=4.9 however MySQL Server 5.6 (mysql-server-5.6) from the default Ubuntu repositories requires libstdc++6 >=4.6. When you install the version of MySQL Server 5.6 (mysql-server-5.6) from the default Ubuntu repositories, it automatically resolves all the package dependencies for you.

To fix the problem you need to remove the MySQL APT Repository and then uninstall all the packages that you installed from the MySQL APT Repository.

To remove the MySQL APT Repository, use a command of the form:

sudo dpkg --remove package-name

where you replace package-name with the package name of the MySQL APT Repository you previously installed. Or else you can also search in the Ubuntu Software Center for the MySQL APT Repository .deb package that you installed and remove it from there.

Then install the MySQL Server 5.6 with the command:

sudo apt install mysql-server-5.6
7
  • I haven't installed any package, only the repo. So removing MySQL apt should resolve unmet dependencies issue? – neo.one Apr 17 '15 at 9:33
  • Yes, this should resolve the unmet dependencies issue. You need to remove the MySQL APT Repository, otherwise it will continue to try to install the same packages from MySQL APT Repository that were causing the unmet dependencies before. If you remove the MySQL APT Repository, then Ubuntu will fetch MySQL Server 5.6 from the default Ubuntu repositories along with all of its dependent packages. – karel Apr 17 '15 at 9:37
  • Tried removing apt: Still getting the dependency error sudo apt-get remove mysql-apt-config Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: libstdc++6 : Depends: gcc-4.9-base (= 4.9.2-10) but 4.9.1-0ubuntu1 is to be installed libstdc++6:i386 : Depends: gcc-4.9-base:i386 (= 4.9.2-10) but 4.9.1-0ubuntu1 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). – neo.one Apr 17 '15 at 9:43
  • Okay, so I'm certain the packages sys admin tried to install are causing the issue. They were not supported by my ubuntu version. The packages are listed under 'Unknown' in Software center. If i try to remove, it shows all the softwares that depend on GNU standard c++ lib and asks to 'Remove All'. So I guess the issue is how can I remove the culprit packages without affecting my system. – neo.one Apr 17 '15 at 9:55
  • Yes, you have correctly identified the cause of the problem and also recognized the danger inherent in removing culprit packages willy-nilly. Your system needs to have at least one version of libstdc++6 to function properly. If you have two versions of libstdc++6 installed, you can remove the version of libstdc++6 from the Unknown source. Also if you have two versions of any package installed, you can remove the version from the Unknown source. But you have to keep at least one working version installed to avoid major problems. – karel Apr 17 '15 at 10:03
1

Use "aptitude" to solve the problem.

sudo apt-get install aptitude
sudo aptitude remove mysql-apt-config

Now follow the proposed solutions.

0

This error occurs because the package you are trying to download and install requires libstdc++6 >=4.9. The latest version of libstdc++6 available on the Ubuntu 14.04 LTS repositories is 4.8.2-19ubuntu1, which is older than 4.9.

I'm assuming that you're running Ubuntu 14.04, because the libstdc++6 package on your computer is stuck at 4.8.2-19ubuntu1. The MySQL APT repository currently has packages for three versions of Ubuntu: 12.04, 14.04 and 14.10. The packages for 12.04 and 14.04 both require only libstdc++6 >=4.6, while 14.10 requires version libstdc++6 >=4.9.

Please check that you've installed the correct mysql-apt-config package for your Ubuntu version.

1
  • Sorry, I did not see your answer. My answer addresses OP using the wrong version for the MySQL apt repository, so it's not completely a duplicate. Nonetheless, I'll delete this answer and edit your answer to include those details when I get home – zhongfu Apr 17 '15 at 10:46
0

libstdc++6 : Depends: gcc-4.9-base (= 4.9.2-10) but 4.9.1-0ubuntu1 is installed

The package gcc-4.9-base (= 4.9.2-10) is only available for Ubuntu Vivid.

Check this (utopic) and this (vivid).

Remove the package mysql-apt-config, installed by these instructions and use mysql-server to get the latest version.

sudo dpkg --force-all -P mysql-apt-config
sudo apt-get install mysql-server
4
  • So I need to install gcc-4.9-base? At the moment I'm more concerned with recovering from unmet dependencies. – neo.one Apr 17 '15 at 9:32
  • Of course: "libstdc++6 : Depends: gcc-4.9-base (= 4.9.2-10) but 4.9.1-0ubuntu1 is installed" – A.B. Apr 17 '15 at 9:33
  • Cannot remove the apt, getting the same error as posted in the question above. – neo.one Apr 17 '15 at 9:44
  • Try this command "sudo dpkg --force-all -P mysql-apt-config" – A.B. Apr 17 '15 at 9:57

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.