Score:0

MySQL - Cannot update to 8.0.31 from 8.0.30 at Ubuntu 22.04.1

bf flag

I have 2 updates that could not be installed automatically.

When I try to upgrade with: sudo apt upgrade then I got this message:

The following packages have been kept back: mysql-client mysql-server

So when I try to install it manually like: sudo apt install mysql-client then I got the following message:

The following packages have unmet dependencies: 
mysql-common : Conflicts: mysql-client-8.0 but 8.0.31-0ubuntu0.22.04.1 is to be installed 
               Conflicts: mysql-client-core-8.0 but 8.0.31-0ubuntu0.22.04.1 is to be installed 
E: Unable to correct problems, you have held broken packages.

and when I try to install: sudo apt install mysql-server

I got this message:

The following packages have unmet dependencies: 
mysql-common : Conflicts: mysql-server-8.0 but 8.0.31-0ubuntu0.22.04.1 is to be installed
mysql-community-client : Conflicts: mysql-server-8.0 but 8.0.31-0ubuntu0.22.04.1 is to be installed 
mysql-server-8.0 : Depends: mysql-client-8.0 (>= 8.0.31-0ubuntu0.22.04.1) but it is not installable 
                   Depends: mysql-server-core-8.0 (= 8.0.31-0ubuntu0.22.04.1) but it is not installable 
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

It is on a production server and if it is possible not to delete everything and reinstall mysql without losing my configuration and/or deleting the databases.

Update:

Output of ~$ apt-cache policy mysql-client-8.0

mysql-client-8.0:
  Installed: (none)
  Candidate: 8.0.31-0ubuntu0.22.04.1
  Version table:
     8.0.31-0ubuntu0.22.04.1 500
        500 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
     8.0.28-0ubuntu4 500
        500 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

Output of ~$ apt-cache policy mysql-server-core-8.0

mysql-server-core-8.0:
  Installed: (none)
  Candidate: 8.0.31-0ubuntu0.22.04.1
  Version table:
     8.0.31-0ubuntu0.22.04.1 500
        500 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
     8.0.28-0ubuntu4 500
        500 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

Output of ~$ sudo apt upgrade

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
#
# News about significant security updates, features and services will
# appear here to raise awareness and perhaps tease /r/Linux ;)
# Use 'pro config set apt_news=false' to hide this and future APT news.
#
The following packages have been kept back:
  mysql-client mysql-server
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
user535733 avatar
cn flag
Well, it seems none of the usual causes that I seek first. Stepping back to let others have a try. Thanks for your prompt responses!
Black Sheep avatar
bf flag
@user535733 - I have to thank you for your help
uz flag
Jos
To me, it looks like `mysql-community-client` is the culprit. Can you remove that and retry to install `mysql-server-8.0`?
Black Sheep avatar
bf flag
@Jos - Sorry for the late reply.. I had to do some backups first! And yes you are right!! I removed `sudo apt purge mysql-community-client` (without removing the data directory) and then I install `sudo apt install mysql-server-8.0`... and everything ok! If you want to post your comment as answer to close this as solved! Thanks. mate
Score:2
uz flag
Jos

The clue is in this error message

mysql-community-client : Conflicts: mysql-server-8.0 but 8.0.31-0ubuntu0.22.04.1 is to be installed 

You have the package mysql-community-client installed. This is a command line client that has the same purpose as the package mysql-client but (I believe) falls under a different license.

Nevertheless, its presence causes the server install to fail. So simply remove it, and retry to install the server.

Afterwards, make sure you have one MySQL client installed at all times for basic maintenance, be it mysql-client or mysql-communit-client.

Score:0
cn flag

This worked for me (zabbix 6.2.7 Ubuntu 22.04).

sudo apt purge mysql-community-client  
sudo apt purge  mysql-common  
sudo apt install mysql-client  
sudo apt install zabbix-server-mysql  

Set mysql password at /etc/zabbix/zabbix_server.conf .

Reboot server.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.