Error during xtradb-cluster installation on ubuntu

I used to run ubuntu 16 with pxc 5.7. After updating to Ubuntu 20.04.2 LTS, I ran the following commands to update the cluster to 8.0:

apt-get remove percona-xtradb-cluster-server-5.7
apt autoremove
dpkg -i percona-release_latest.generic_all.deb
apt-get update
percona-release setup pxc80
apt update
percona-release enable tools release
apt update
apt install percona-xtradb-cluster

During the installation process, the following error is encountered:

Do you want to continue? [Y/n]
Preconfiguring packages ...
Selecting previously unselected package percona-xtradb-cluster-common.
(Reading database ... 115274 files and directories currently installed.)
Preparing to unpack .../percona-xtradb-cluster-common_1%3a8.0.22-13-1.focal_amd64.deb ...
Unpacking percona-xtradb-cluster-common (1:8.0.22-13-1.focal) ...
Selecting previously unselected package percona-xtradb-cluster-client.
Preparing to unpack .../percona-xtradb-cluster-client_1%3a8.0.22-13-1.focal_amd64.deb ...
Unpacking percona-xtradb-cluster-client (1:8.0.22-13-1.focal) ...
Setting up percona-xtradb-cluster-common (1:8.0.22-13-1.focal) ...
(Reading database ... 115300 files and directories currently installed.)
Preparing to unpack .../percona-xtradb-cluster-server_1%3a8.0.22-13-1.focal_amd64.deb ...
/var/lib/dpkg/ line 10: /var/lib/mysql/service.state: No such file or directory
dpkg: error processing archive /var/cache/apt/archives/percona-xtradb-cluster-server_1%3a8.0.22-13-1.focal_amd64.deb (--unpack):
 new percona-xtradb-cluster-server package pre-installation script subprocess returned error exit status 1
Selecting previously unselected package percona-xtradb-cluster.
Preparing to unpack .../percona-xtradb-cluster_1%3a8.0.22-13-1.focal_amd64.deb ...
Unpacking percona-xtradb-cluster (1:8.0.22-13-1.focal) ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

The folder /var/lib/mysql doesn’t exist on my machine. I would assume that percona installs it, because it also installed a mysql binary at /usr/bin during the failed installation mentioned above.

What am I missing here?

1 Like

Hi @hildebro

This issue appears as apt removed only server packages but all other 5.7 connected packages were left.
It is better to remove these packages in the following way:
dpkg --purge percona-xtradb-cluster-server-5.7 percona-xtradb-cluster-common-5.7 percona-xtradb-cluster-client-5.7 percona-xtrabackup-24

1 Like