I'm trying to install mysql but can't because of the following error:
set@set-home ~ $ sudo apt-get install mysql-server -f
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:i386 : Breaks: libstdc++6 (!= 8.1.0-5ubuntu1~14.04) but 8.2.0-9 is to be installed
libstdc++6 : Depends: gcc-8-base (= 8.2.0-9) but 8.1.0-5ubuntu1~14.04 is to be installed
Breaks: libboost-date-time1.54.0 but 1.54.0-4ubuntu3.1 is to be installed
Breaks: libstdc++6:i386 (!= 8.2.0-9) but 8.1.0-5ubuntu1~14.04 is to be installed
mysql-server : Depends: mysql-server-5.5 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
I have tried:
- sudo apt-get -f install
- sudo apt-get -u dist-upgrade
- sudo apt-get autoclean
- sudo apt-get clean
but all this with no luck. How can I solve this?
Let's look at the available packages in the Ubuntu repositories for
libstdc++6
:Aha. Neither of your two options, 8.1.0-5ubuntu1~14.04 nor 8.2.0-9 is from the Ubuntu repositories.
Now we know the problem: You have unwisely added non-Ubuntu sources that are providing packages that are incompatible with your release of Ubuntu. This is also called a 'version conflict' or 'held broken packages'. They are not really "broken", just wrong version...but they do break your system.
The solution is to uninstall ALL packages from that unwise source, and then to delete that source. Return your system to using packages provided by the Ubuntu repositories. Then MySQL will install.
If you don't know how to uninstall packages from a specific source, then see How can PPAs be removed? for instructions on how to install and use the
ppa-purge
command.