Upgrade mysql5.0 -> 5.1 fails due to error on postrm script.

Bug #670541 reported by Mark - Syminet
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mysql-5.1 (Ubuntu)
Expired
Medium
Unassigned

Bug Description

Binary package hint: mysql-server-5.1

Hardy -> Lucid upgrade, after which phpmyadmin warns about mysql-server5.0 whereas
the php library is 5.1 and thus conflicts. OK, lets upgrade - but mysql upgrade fails due to
what looks like a typo in the postrm script:

===
Preconfiguring packages ...
(Reading database ... 40610 files and directories currently installed.)
Removing mysql-server-5.0 ...
 * Stopping MySQL database server mysqld
   ...done.
/var/lib/dpkg/info/mysql-server-5.0.postrm: line 38: syntax error near unexpected token `fi'
dpkg: error processing mysql-server-5.0 (--remove):
 subprocess installed post-removal script returned error exit status 2
Removing mysql-client-5.0 ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Errors were encountered while processing:
 mysql-server-5.0
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@28r6s1:/etc/apache#
===

For me, the quick fix was to edit /var/lib/dpkg/info/mysql-server-5.0.postrm
shellscript and simply make this the first line:

exit 0;

...hopefully this didn't cause some sort of breakage that will bite us at
some indeterminable point in the future. But it at least got the critical
mysql service running again on that server.

Revision history for this message
Mathias Gug (mathiaz) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

Could attach your version of the postrm script from /var/lib/dpkg/info/mysql-server-5.0.postrm?

Changed in mysql-5.1 (Ubuntu):
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Mark - Syminet (mark-syminet) wrote :
Download full text (9.0 KiB)

Hello, sure, here you go (I removed my "exit 0;" at the top):

=== snip ===

#!/bin/bash -e

# It is possible that Debconf has already been removed, too.
if [ -f /usr/share/debconf/confmodule ]; then
  . /usr/share/debconf/confmodule
fi

if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }

MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"

# Try to stop the server in a sane way. If it does not success let the admin
# do it himself. No database directories should be removed while the server
# is running!
stop_server() {
  set +e
  if [ -x /usr/sbin/invoke-rc.d ]; then
    invoke-rc.d mysql stop
  else
    /etc/init.d/mysql stop
  fi
  errno=$?
  set -e

  if [ "$?" != 0 ]; then
    echo "Trying to stop the MySQL server resulted in exitcode $?." 1>&2
    echo "Stop it yourself and try again!" 1>&2
    exit 1
  fi
}

case "$1" in
  purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
    if [ -n "`$MYADMIN ping...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in mysql-5.1 (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

Remote bug watches

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