Dpkg: error dpkg: error processing package mysql-community-server (–configure):
Whether sudo apt upgrade or sudo apt autoremove is used, the problem remains.
Use mysql deb package to install report error:
sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
libmysqlclient-dev mysql-client mysql-server mysql-testsuite
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue?[Y/n] y
Setting up mysql-community-server (5.7.37-1ubuntu18.04) ...
update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn't exist
dpkg: error processing package mysql-community-server (--configure):
installed mysql-community-server package post-installation script subprocess returned error exit status 2
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-community-server (= 5.7.37-1ubuntu18.04); however:
Package mysql-community-server is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mysql-community-test:No apport report written because the error message indicates its a followup error from a previous failure.
mysql-community-test depends on mysql-community-server (= 5.7.37-1ubuntu18.04); however:
Package mysql-community-server is not configured yet.
dpkg: error processing package mysql-community-test (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mysql-testsuite:No apport report written because the error message indicates its a followup error from a previous failure.
mysql-testsuite depends on mysql-community-test (= 5.7.37-1ubuntu18.04); however:
Package mysql-community-test is not configured yet.
dpkg: error processing package mysql-testsuite (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
The solution is as follows:
Try the following command
sudo apt-get install -f
To see if it can fix broken dependencies
If failed, clear MySQL server:
sudo apt-get purge mysql-community-server mysql-community-server
Then clean up and update:
sudo apt-get autoclean && sudo apt-get clean && sudo apt-get update
General upgrade:
sudo apt-get upgrade
Now try reinstalling:
sudo apt-get install mysql-server and mysql-community-server
If you do this from the root prompt, the leading sudo command will not be booted