Error trying to install Percona MySQL on Ubunut 22.04

Hello,
I have been using the standard version of MySQL 8.0 but wanted to switch. As far as I understand it should be supported for Ubuntu but it fails every time on the (–fix-broken install commands not helping either) installation process. Before the installation I made sure to remove every existing mysql package. It goes fine up until the 7. step in the guide but I get the following error when running the 8. step.

Setting up percona-server-common (8.0.31-23-1.jammy) ...
Setting up percona-server-client (8.0.31-23-1.jammy) ...
Setting up percona-server-server (8.0.31-23-1.jammy) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my
.cnf) in auto mode
2023-03-09T18:07:26.283953Z 0 [Warning] [MY-010918] [Server] 'default_authentica
tion_plugin' is deprecated and will be removed in a future release. Please use a
uthentication_policy instead.
2023-03-09T18:07:26.284000Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (my
sqld 8.0.31-23) initializing of server in progress as process 82630
2023-03-09T18:07:26.292873Z 0 [ERROR] [MY-010124] [Server] Fatal error: Can't ch
ange to run as user 'mysql' ;  Please check that the user exists!
2023-03-09T18:07:26.292887Z 0 [ERROR] [MY-013236] [Server] The designated data d
irectory /var/lib/mysql/ is unusable. You can remove all files that the server a
dded to it.
2023-03-09T18:07:26.293035Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-03-09T18:07:26.293342Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Sh
utdown complete (mysqld 8.0.31-23)  Percona Server (GPL), Release '23', Revision
 '71449379'.
dpkg: error processing package percona-server-server (--configure):
 installed percona-server-server package post-installation script subprocess ret
urned error exit status 1
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Errors were encountered while processing:
 percona-server-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have followed the advice of someone on the askUbuntu forum to check the logs but I couldn’t find anything noteworthy. Is there any solution I could try?

I tried the 8.0.31 and .30 versions on Ubuntu 22.04 with APT.

Hi @kaPa
I’ve checked the installation process on Ubuntu Jammy(22.04) and all goes fine as per the documentation.
Have you removed the old “/var/lib/mysql/” directory from the previous mysql installation? If not, please make a backup of that folder(in order not to lose data if you have any there), remove/or move into safe folder the “/var/lib/mysql/” directory and try to rerun the installation process.