I have 2 mysql
updates that cannot be installed on a 20.04:
2 updates could not be installed automatically. For more details,
see /var/log/unattended-upgrades/unattended-upgrades.log
I tried the following:
$ sudo apt install mysql-server-8.0 mysql-client-8.0
The following packages have unmet dependencies:
mysql-client-8.0 : Depends: mysql-common (>= 5.5)
mysql-server-8.0 : PreDepends: mysql-common (>= 5.5)
Depends: mysql-common (>= 5.8+1.0.4~)
$ sudo apt-get --with-new-pkgs upgrade
The following packages have been kept back:
mysql-client mysql-server
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
$ sudo apt list mysql* --installed
mysql-apt-config/now 0.8.16-1 all [installed,local]
mysql-client/now 8.0.22-1ubuntu18.04 amd64 [installed,upgradable to: 8.0.23-0ubuntu0.20.04.1]
mysql-common/now 8.0.22-1ubuntu18.04 amd64 [installed,local]
mysql-community-client-core/now 8.0.22-1ubuntu18.04 amd64 [installed,local]
mysql-community-client-plugins/now 8.0.22-1ubuntu18.04 amd64 [installed,local]
mysql-community-client/now 8.0.22-1ubuntu18.04 amd64 [installed,local]
mysql-community-server-core/now 8.0.22-1ubuntu18.04 amd64 [installed,local]
mysql-community-server/now 8.0.22-1ubuntu18.04 amd64 [installed,local]
mysql-server/now 8.0.22-1ubuntu18.04 amd64 [installed,upgradable to: 8.0.23-0ubuntu0.20.04.1]
How can I resolve them?
You appear to have both MySQL Server and MySQL Community Server installed on your machine, which could result in a great number of conflicts. MySQL Server is the version put out by Canonical for Ubuntu, while MySQL Community Server is put out by Oracle with its own release cadence. You will need to choose one over the other and, hopefully, the one being removed will not ruin the one that remains.
The most logical way to do this would probably be to remove both MySQL Server and MySQL Community Server, then re-install the one you want to use. Your existing database files and configurations should not be lost during this process, but do have backups ready "just in case".
Here's the order that things should be done:
Ensure MySQL is not running:
If you see something like this:
Then you will need to stop the server like this:
Remove the MySQL packages listed in
sudo apt list mysql* - -installed
, which you have already provided as part of your question:You will get a very long list of packages that are about to be removed. Read through them all to make sure there are no surprises that might break other important packages running on your system. If everything is good, proceed with the removal.
Clean
apt
:Re-install the MySQL version you want (for example, the Canonical-supplied version):
Run the secure installation procedure and set a good
root
password:When done, connect to MySQL remembering that in version 8.0 and above, you need
sudo
to connect asroot
:If everything to this point is good, check that your databases are still in place with
SHOW DATABASES
and consider creating an administrator account to access MySQL without needingsudo
if you don't already have one.(Optional Step) Confirm the MySQL packages installed:
Hope this helps get you running again ??