package mysql-server-5.6 5.6.23-1~exp1~ubuntu5 failed to install/upgrade: subprocess installed post-removal script returned error exit status 1

Bug #1438788 reported by Argenis Bolivar
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
mysql-5.6 (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

The service not automatic start and try to remove

/usr/bin/deb-systemd-helper: error: unable to link /etc/systemd/system/mysql.service to /dev/null: File exists

try to reinstall:

dpkg: error processing package mysql-server-5.6 (--configure):
 package mysql-server-5.6 is not ready for configuration
 cannot configure (current status `half-installed')
Errors were encountered while processing:
 mysql-server-5.6
E: Sub-process /usr/bin/dpkg returned an error code (1)

ProblemType: Package
DistroRelease: Ubuntu 15.04
Package: mysql-server-5.6 5.6.23-1~exp1~ubuntu5
ProcVersionSignature: Ubuntu 3.19.0-10.10-generic 3.19.2
Uname: Linux 3.19.0-10-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.17-0ubuntu1
AptOrdering:
 mysql-server-5.6: Purge
 NULL: �<��
Architecture: amd64
Date: Tue Mar 31 11:39:44 2015
DpkgTerminalLog:
 Removing mysql-server-5.6 (5.6.23-1~exp1~ubuntu5) ...
 update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
 /usr/bin/deb-systemd-helper: error: unable to link /etc/systemd/system/mysql.service to /dev/null: File exists
 dpkg: error processing package mysql-server-5.6 (--purge):
  subprocess installed post-removal script returned error exit status 1
DuplicateSignature: package:mysql-server-5.6:5.6.23-1~exp1~ubuntu5:subprocess installed post-removal script returned error exit status 1
ErrorMessage: subprocess installed post-removal script returned error exit status 1
InstallationDate: Installed on 2015-03-05 (25 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Alpha amd64 (20150305)
RelatedPackageVersions:
 dpkg 1.17.24ubuntu1
 apt 1.0.9.7ubuntu3
SourcePackage: mysql-5.6
Title: package mysql-server-5.6 5.6.23-1~exp1~ubuntu5 failed to install/upgrade: subprocess installed post-removal script returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Argenis Bolivar (abolivar) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Oleg Strikov (strikov-deactivatedaccount) wrote :

Hi Argenis,

Thanks for reporting the bug.

I was not able to reproduce the bug on a fresh installation of 15.04.
It looks like this issue happens when you upgrade the package from ubuntu4 to ubuntu5.
I think that the following workaround may resolve the issue:
$ sudo rm /etc/systemd/system/mysql.service

After running this command you (theoretically) should be able to purge and install the package w/o any issue.
Please let us now if it helps you or not.

Changed in mysql-5.6 (Ubuntu):
assignee: nobody → Oleg Strikov (strikov)
Revision history for this message
Oleg Strikov (strikov-deactivatedaccount) wrote :

Hi Argenis,

Today I tried to upgrade from 5.6.23-1~exp1~ubuntu4 to 5.6.23-1~exp1~ubuntu5 and reproduce the issue you observed.
Here is what I found:

Upgrade from ~ubuntu4 to ~ubuntu5 runs smoothly.
Mysql service starts after upgrade and automatically starts after reboot.
I can't reproduce the fact that service doesn't start automatically.
I assume that you observed the issue with autostart while using previous version of the package (~ubuntu4) i.e. one you used before the upgrade.
Could you please confirm that?
If so -- you met this bug: https://bugs.launchpad.net/ubuntu/+source/mysql-5.6/+bug/1435823
It was fixed in the latest version of the package.

I was able to reproduce the issue with upgrading the package (second part of the bug):
Removing mysql-server-5.6 (5.6.23-1~exp1~ubuntu5) ...
/usr/bin/deb-systemd-helper: error: unable to link /etc/systemd/system/mysql.service to /dev/null: File exists

Please note that this issue is not related to the latest package (~ubuntu5) itself.
It happens because the previous version (~ubuntu4) created incorrect symlink at /etc/systemd/system/ which can't be removed while removing the package.
Latest version of the package won't create this symlink but you need to manually remove the link created by the previous version of the package. Once you do it -- you won't observe this issue in future.

To fix this issue run the following command when apt-get remove/purge crashes:
$ sudo rm /etc/systemd/system/mysql.service
Now, re-run remove/purge. It should finish correctly this time.
After carrying out this procedure you can reinstall mysql back. You won't observe the issue again.
You may use this bug as a reference: https://bugs.launchpad.net/ubuntu/+source/mysql-5.6/+bug/1436178

Please try to apply this workaround and let us know if it helps you or not.
Thanks for reporting the bug!

Revision history for this message
Oleg Strikov (strikov-deactivatedaccount) wrote :

'I was able to reproduce the issue with upgrading the package (second part of the bug):'
should be
'I was able to reproduce the issue with REMOVING the package (second part of the bug):'

Revision history for this message
Oleg Strikov (strikov-deactivatedaccount) wrote :

I plan to change the status of this bug to Won't Fix and here is the explanation for this decision. We can theoretically fix this issue in mysql package. In the postrm handler we need to check if this problematic symlink exists and remove it before passing control to deb-systemd-helper. I don't think this is reasonable decision though. If we put this code into the package we'd be required to leave it there forever (users may upgrade from buggy ubuntu4 to ubuntu5-6-7-8 and then make decision to remove the package). Keeping it there forever is bad because we're doing systemd's and deb-systemd-helper's work by managing symlinks inside /etc/systemd/system/ and this fact may lead to unpredictable issues in the future. Workaround (see above) is pretty straightforward and shouldn't create any issues for vivid users.

Revision history for this message
Robie Basak (racb) wrote :

Marking Won't Fix on Oleg's request. I note that a workaround is available, and this issue only affects users who tracked Vivid during development - after release, nobody upgrading from Utopic will be affected.

Changed in mysql-5.6 (Ubuntu):
status: New → Won't Fix
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.