Co-installation of mysql and mariadb can cause 'Link has been severed' failure on mysql.service when purging

Bug #1928818 reported by Intellego
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
mysql-8.0 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

dpkg: error processing package mysql-server-8.0 (--remove):
 installed mysql-server-8.0 package pre-removal script subprocess returned error
 exit status 1
dpkg: too many errors, stopping
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
Failed to preset unit: File mysql.service: Link has been severed
/usr/bin/deb-systemd-helper: error: systemctl preset failed on mysql.service: No
 such file or directory
Failed to start mysql.service: Unit mysql.service not found.
invoke-rc.d: initscript mysql, action "start" failed.
Unit mysql.service could not be found.
dpkg: error while cleaning up:
 installed mysql-server-8.0 package post-installation script subprocess returned
 error exit status 1
Errors were encountered while processing:
 mysql-server-8.0
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

ProblemType: Package
DistroRelease: Ubuntu 20.10
Package: mysql-server-8.0 8.0.25-0ubuntu0.20.10.1
ProcVersionSignature: Ubuntu 5.8.0-53.60-generic 5.8.18
Uname: Linux 5.8.0-53-generic x86_64
ApportVersion: 2.20.11-0ubuntu50.6
Architecture: amd64
CasperMD5CheckResult: skip
Date: Tue May 18 09:59:53 2021
ErrorMessage: installed mysql-server-8.0 package pre-removal script subprocess returned error exit status 1
InstallationDate: Installed on 2020-03-02 (442 days ago)
InstallationMedia: Ubuntu 18.04.4 LTS "Bionic Beaver" - Release amd64 (20200203.1)
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_control', 'ibdata1', 'ib_buffer_pool', 'performance_schema', 'ib_logfile0', 'debian-10.3.flag', 'nextcloud', 'multi-master.info', 'mysql_upgrade_info', 'mysql', 'aria_log.00000001', 'ib_logfile1']
ProcCmdline: BOOT_IMAGE=/boot/vmlinuz-5.8.0-53-generic root=UUID=97d89be7-de92-41d4-8a05-7573c4523062 ro quiet splash vt.handoff=7
Python3Details: /usr/bin/python3.8, Python 3.8.6, python3-minimal, 3.8.6-0ubuntu1
PythonDetails: /usr/bin/python2.7, Python 2.7.18, python-is-python2, 2.7.17-4
RelatedPackageVersions:
 dpkg 1.20.5ubuntu2
 apt 2.1.10ubuntu0.3
SourcePackage: mysql-8.0
Title: package mysql-server-8.0 8.0.25-0ubuntu0.20.10.1 failed to install/upgrade: installed mysql-server-8.0 package pre-removal script subprocess returned error exit status 1
UpgradeStatus: Upgraded to groovy on 2021-05-17 (0 days ago)

Revision history for this message
Intellego (intellego) wrote :
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thank you for taking the time to file a bug report.

Based on the logs you posted, it seems like you have both MySQL and MariaDB installed in the system. This scenario is not really supported and can lead to errors, especially during the upgrade/removal processes, which is your case. It seems like you tried purging the MySQL packages *after* having installed MariaDB. Could you please try doing the opposite? First, purge MySQL and make sure that there is no mysql-server daemon running. Then, install MariaDB.

If you still experience problems doing this, please let us know and try to provide as much detail as you can so that we can attempt to reproduce the issue.

Since it seems likely to me that this is a local configuration problem,
rather than a bug in Ubuntu, I am marking this bug as 'Incomplete'.

However, if you believe that this is really a bug in Ubuntu, then we would
be grateful if you would provide a more complete description of the problem
with steps to reproduce, explain why you believe this is a bug in Ubuntu
rather than a problem specific to your system, and then change the bug
status back to "New".

For local configuration issues, you can find assistance here:
http://www.ubuntu.com/support/community

Changed in mysql-8.0 (Ubuntu):
status: New → Incomplete
Bryce Harrington (bryce)
summary: - package mysql-server-8.0 8.0.25-0ubuntu0.20.10.1 failed to
- install/upgrade: installed mysql-server-8.0 package pre-removal script
- subprocess returned error exit status 1
+ Co-installation of mysql and mariadb can cause 'Link has been severed'
+ failure on mysql.service when purging
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for mysql-8.0 (Ubuntu) because there has been no activity for 60 days.]

Changed in mysql-8.0 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers