package mysql-server-8.0 8.0.21-0ubuntu0.20.04.3 failed to install/upgrade: installed mysql-server-8.0 package pre-removal script subprocess returned error exit status 1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mysql-8.0 (Ubuntu) |
Triaged
|
Undecided
|
Unassigned |
Bug Description
Trying to remove mysql and I got this.
ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: mysql-server-8.0 8.0.21-
ProcVersionSign
Uname: Linux 5.4.0-42-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.4
Architecture: amd64
CasperMD5CheckR
Date: Wed Jul 29 03:03:07 2020
ErrorMessage: installed mysql-server-8.0 package pre-removal script subprocess returned error exit status 1
InstallationDate: Installed on 2020-07-26 (2 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
KernLog:
Logs.var.
MySQLConf.
MySQLConf.
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
MySQLVarLibDirL
ProcCmdline: BOOT_IMAGE=
Python3Details: /usr/bin/python3.8, Python 3.8.2, python3-minimal, 3.8.2-0ubuntu2
PythonDetails: /usr/bin/python2.7, Python 2.7.18rc1, python-is-python2, 2.7.17-4
RelatedPackageV
dpkg 1.19.7ubuntu3
apt 2.0.2ubuntu0.1
SourcePackage: mysql-8.0
Title: package mysql-server-8.0 8.0.21-
UpgradeStatus: No upgrade log present (probably fresh install)
Thanks for this bug report. The problem can be reproduced by running the following in a fresh Focal LXD container:
apt update
apt install mariadb-server
apt remove mariadb-server
apt install mysql-server
At this point mysql is in a very broken state. Its systemd units looks masked:
# systemctl status mysql
Unit mysql.service could not be found.
and this is why trying to remove it with:
apt remove mysql-server-8.0
fails, as the uninstall process tried to `systemctl stop` the service. This is the error this bug report is about, but it's worse. If at this point we purge mariadb:
apt purge mariadb-server-10.3
it will also delete the mysql user, which at this point should be "owned" by mysql - and possibly other things.
It seems that a Conflicts relationship between the two packages is not strong enough. Maybe Breaks could avoid this?