I could not uninstalled mysql-server
because there are unmet dependencies after uninstalling MariaDB...
So I tried all possible combinations with apt-get
and dpkg
to forcefully remove the remains of MySQL and MariaDB... Finally, unfortunately I also manually deleted all files in the directory tree, which contained anything in the name from MySQL or MariaDB...
$ sudo dpkg --audit
The following packages have been unpacked but not yet configured.
They must be configured using dpkg --configure or the configure
menu option in dselect for them to work:
mysql-server MySQL Server meta package depending on latest version
The following packages are missing the list control file in the
database, they need to be reinstalled:
mariadb-client MariaDB database client (metapackage depending on the lat
mariadb-server-10.0 MariaDB database server binaries
mariadb-server-core-10.0 MariaDB database core server files
The following packages are missing the md5sums control file in the
database, they need to be reinstalled:
mariadb-client MariaDB database client (metapackage depending on the lat
mariadb-server-10.0 MariaDB database server binaries
mariadb-server-core-10.0 MariaDB database core server files
But I still can not re-install MySQL because the dependencies associated with MariaDB are missing and vice versa...
$ sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (5.7.22-1ubuntu16.04).
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
mariadb-client : Depends: mariadb-client-10.0 (>= 10.0.34-0ubuntu0.16.04.1) but it is not going to be installed
mariadb-server-10.0 : PreDepends: mariadb-common (>= 10.0.34-0ubuntu0.16.04.1) but it is not going to be installed
Depends: mariadb-client-10.0 (>= 10.0.34-0ubuntu0.16.04.1) but it is not going to be installed
Breaks: mysql-server
mariadb-server-core-10.0 : Depends: mariadb-common (>= 10.0.34-0ubuntu0.16.04.1) but it is not going to be installed
mysql-server : Depends: mysql-community-server (= 5.7.22-1ubuntu16.04) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
$ sudo dpkg --configure mysql-server
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-community-server (= 5.7.22-1ubuntu16.04); however:
Package mysql-community-server is not installed.
mariadb-server-10.0 (10.0.34-0ubuntu0.16.04.1) breaks mysql-server and is installed.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
To solve this problem, follow the instructions below:
sudo apt-get -f install
without any other parameters and later displaying all packages via:
sudo dpkg -l | grep mariadb
sudo dpkg -l | grep mysql
remove problematic packages in the right order:
sudo apt-get --purge autoremove package_name
After the complete removal of all problematic packages, re-install MySQL