Unmet dependencies unable to fix

7,621

Solution 1

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

Solution 2

Use "aptitude" to solve the problem.

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

Now follow the proposed solutions.

Share:
7,621

Related videos on Youtube

neo.one
Author by

neo.one

Updated on September 18, 2022

Comments

  • neo.one
    neo.one over 1 year

    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.

    • Admin
      Admin about 9 years
      Where are you installing mysql-server from? An external repository, or Ubuntu's repositories?
    • Admin
      Admin about 9 years
      I used mysql apt repository from link.
  • neo.one
    neo.one about 9 years
    So I need to install gcc-4.9-base? At the moment I'm more concerned with recovering from unmet dependencies.
  • A.B.
    A.B. about 9 years
    Of course: "libstdc++6 : Depends: gcc-4.9-base (= 4.9.2-10) but 4.9.1-0ubuntu1 is installed"
  • neo.one
    neo.one about 9 years
    I haven't installed any package, only the repo. So removing MySQL apt should resolve unmet dependencies issue?
  • karel
    karel about 9 years
    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.
  • neo.one
    neo.one about 9 years
    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
    neo.one about 9 years
    Cannot remove the apt, getting the same error as posted in the question above.
  • neo.one
    neo.one about 9 years
    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.
  • A.B.
    A.B. about 9 years
    Try this command "sudo dpkg --force-all -P mysql-apt-config"
  • karel
    karel about 9 years
    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.
  • zhongfu
    zhongfu about 9 years
    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
  • neo.one
    neo.one about 9 years
    So how can i do that? How can i make sure that I remove the unwanted package without breaking the system? As I said already, ubuntu software center doesn't seem to be the right choice as it asks to remove all dependant packages as well.
  • karel
    karel about 9 years
    Find the location of every unwanted file that you are scared to remove and instead of removing it, rename myFile to myFile.bak for every unwanted file. Then if anything breaks rename myFile.bak back to its original name myFile. You can do all this from the terminal (Ctrl+Alt+T) or from the console (Ctrl+Alt+F1) even if you break some GUI things.