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

Bug #1889328 reported by D
36
This bug affects 8 people
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-0ubuntu0.20.04.3
ProcVersionSignature: Ubuntu 5.4.0-42.46-generic 5.4.44
Uname: Linux 5.4.0-42-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.4
Architecture: amd64
CasperMD5CheckResult: skip
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.log.daemon.log:

MySQLConf.etc.mysql.conf.d.mysql.cnf: [mysql]
MySQLConf.etc.mysql.conf.d.mysqldump.cnf:
 [mysqldump]
 quick
 quote-names
 max_allowed_packet = 16M
MySQLVarLibDirListing: ['aria_log.00000001', 'aria_log_control', 'multi-master.info', 'performance_schema', 'ibdata1', 'ib_logfile0', 'ib_logfile1', 'ib_buffer_pool', 'debian-10.3.flag', 'mysql']
ProcCmdline: BOOT_IMAGE=/boot/vmlinuz-5.4.0-42-generic root=UUID=06a583c0-405d-40fc-9b81-57f15a2b0ffe ro quiet splash vt.handoff=7
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
RelatedPackageVersions:
 dpkg 1.19.7ubuntu3
 apt 2.0.2ubuntu0.1
SourcePackage: mysql-8.0
Title: 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
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
D (damkeny) wrote :
Revision history for this message
Paride Legovini (paride) wrote :

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?

Changed in mysql-8.0 (Ubuntu):
status: New → Triaged
tags: added: server-next
Revision history for this message
Paride Legovini (paride) wrote :

As noted by Robie @racb this is fundamentally a duplicate of:

https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1490071

tags: removed: server-next
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.