Uninstall MySQL from Ubuntu 16.04

I am trying to uninstall MySQL completely from Ubuntu 16.04 LTS,but I am facing an issue saying:

The following packages have unmet dependencies:
mariadb-client-10.0 : Depends: libdbd-mysql-perl (>= 1.2202) but it is not going to be installed
mariadb-client-core-10.0 : Depends: mariadb-common (>= 10.0.24-7) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

I tried also to uninstall Mariadb but I have always the same problem.
Any idea !!

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

I finally uninstall MySQL completely, and reinstall it using these lines :

Remove all files related to MySQL

sudo apt-get purge mysql*

sudo apt-get autoremove

sudo apt-get autoclean

Then upgrade my distribution

sudo apt-get dist-upgrade

Then install MySQL

sudo apt-get install mysql-server

That’s all.

Solution 2

As Tico pointed out, if you installed dbconfig-mysql uninstall that first

This worked for me

sudo apt-get remove dbconfig-mysql

after that I could continue with removing mysql-client and mysql-server

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply