package mysql-server-5.1 5.1.31-1ubuntu2 failed to install/upgrade: subprocess pre-removal script returned error exit status 1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
debhelper (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
mysql-dfsg-5.1 (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Description: Ubuntu 9.04
Release: 9.04
sudo apt-get install phpmyadmin
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
postfix libhtml-
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
dbconfig-common libgd2-xpm libmcrypt4 libt1-5 mysql-client mysql-client-5.0
php5-gd php5-mcrypt
Suggested packages:
libgd-tools libmcrypt-dev mcrypt mysql-doc-5.0 mysql-server
The following packages will be REMOVED:
libgd2-noxpm mysql-client-5.1 mysql-server-5.1
The following NEW packages will be installed:
dbconfig-common libgd2-xpm libmcrypt4 libt1-5 mysql-client mysql-client-5.0
php5-gd php5-mcrypt phpmyadmin
0 upgraded, 9 newly installed, 3 to remove and 0 not upgraded.
Need to get 12.5MB of archives.
After this operation, 9523kB disk space will be freed.
Do you want to continue [Y/n]?
[stuff got downloaded]
Preconfiguring packages ...
(Reading database ... 123330 files and directories currently installed.)
Removing mysql-server-5.1 ...
* Stopping MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing mysql-server-5.1 (--remove):
subprocess pre-removal script returned error exit status 1
* Stopping MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "stop" failed.
* Starting MySQL database server mysqld [ OK ]
dpkg: mysql-client-5.1: dependency problems, but removing anyway as you request:
mysql-server-5.1 depends on mysql-client-5.1 (>= 5.1.31-1ubuntu2).
Removing mysql-client-5.1 ...
dpkg: libgd2-noxpm: dependency problems, but removing anyway as you request:
libgraphviz4 depends on libgd2-noxpm (>= 2.0.36~rc1~dfsg) | libgd2-xpm (>= 2.0.36~rc1~dfsg); however:
Package libgd2-noxpm is to be removed.
Package libgd2-xpm is not installed.
Removing libgd2-noxpm ...
Processing triggers for man-db ...
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
mysql-server-5.1
E: Sub-process /usr/bin/dpkg returned an error code (1)
ProblemType: Package
Architecture: i386
DistroRelease: Ubuntu 9.04
ErrorMessage: subprocess pre-removal script returned error exit status 1
Package: mysql-server-5.1 5.1.31-1ubuntu2
SourcePackage: mysql-dfsg-5.1
Title: package mysql-server-5.1 5.1.31-1ubuntu2 failed to install/upgrade: subprocess pre-removal script returned error exit status 1
Uname: Linux 2.6.28-19-generic i686
Patrick, thank you for reporting this bug so we can make Ubuntu better!
I've looked at the prerm script, and it would appear that this was fixed in newer versions of the packaging tool debhelper (specifically, dh_installinit's generated prerm code no longer returns an error if the stop fails).
The version you have in 9.04 does this:
# Automatically added by dh_installinit
if [ -x "/etc/init.d/mysql" ]; then
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d mysql stop || exit $?
else
/etc/init.d/mysql stop || exit $?
fi
fi
# End automatically added section
Which will return the error code of the init script.
Whereas in the latest mysql-server-5.1 package, this is run:
# Automatically added by dh_installinit mysql.conf" ]; then
if [ -e "/etc/init/
# stop fails if not running
stop mysql || :
fi
# End automatically added section
Which will not return an error, and so should not cause problems during removal.
I am marking this bug as "Fix Released", and attaching it to debhelper as well.