Ubuntu – Unmet dependencies unable to fix


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.

Best Answer

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
Related Question