MySQL client and server has broken dependencies when trying to upgrade through the package manager in the Wordpress 1 click droplet

I was trying to do some maintenance on my new droplet, but every time I try to upgrade mysql, I get this error from APT:

The following packages have unmet dependencies:
 mysql-client : Depends: mysql-client-8.0 but it is not going to be installed
 mysql-community-server : Depends: mysql-client (= 8.0.26-1ubuntu20.04) but 8.0.28-0ubuntu0.20.04.3 is to be installed
E: Broken packages

How can I upgrade these? --fix-broken-install isn’t working either

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Ok, so here’s what I did to solve it.

First, I typed:

sudo apt-key adv --keyserver --recv-keys 467B942D3A79BD29

Then, I proceeded to use apt update and then I was able to update

Site Moderator
Site Moderator badge
April 26, 2022

Hi @s0ulf3re,

Try forcing the MySQL upgrade with the following:

  1. sudo apt install -f mysql-client=8.0.26-1ubuntu20.04

Before that do a backup of your databases:

  1. mysqldump --user root --password --all-databases > all-databases.sql

Lastly if the above doesn’t help, you can always reinstall the MySQL and import all the databases inside again.