mysql-server while upgrading Debian 5.0 (lenny) to 6.0 (squeeze)

I'm currently doing plenty of upgrades to Debian 6.0 for customers who tried to wait till the last moment, after all Lenny's security support ended on 9th of February, see

And one thing I stumble upon each and every time: the mysql-server upgrade does not work OOTB.

So, while doing the upgrade according to the Squeeze release notes there's the point (after the first reboot into the new kernel) where you're supposed to upgrade the rest of the software (4.4.6 in the release notes). This removed the mysql-server each and every time I upgraded, so what I do every time is:

apt-get install mysql-server
dpkg --purge mysql-server-5.0
/etc/init.d/mysql start
# and finally according to the release notes
apt-get dist-upgrade

This will

  • upgrade mysql-server, which installs mysql-server-5.1 and mysql-client-5.1 through the package's dependencies
  • purge mysql-server-5.0, otherwise you can't upgrade to dependency based booting, see
  • start the mysql server again, since it's stopped by the purging of mysql-server-5.0, which is unfortunately an open bug, see
  • actually finish the Debian upgrade