Upgrading Lenny to Squeeze on Rackspace Cloud

Richard Benson27 April 2012IT Pros, Administrationcomments

Debian 5 (Lenny) is now out of support it will not be receiving any more security or bug fix updates, meaning an upgrade to 6 (Squeeze) is required.  The procedure is reasonably simple, however if you are using Lenny on a Rackspace Cloud server, you will get an error relating to "dependency based startup".  Furthermore, if you are using MySQL 5, you will need to upgrade that to 5.1 and this itself has a pitfall if you have based your config on the stock my.cnf.  Below is the procedure for upgrading Debian Lenny to Squeeze on Rackspace Cloud with MySQL installed.

Some of the following steps may not be strictly necessary, but we have run this upgrade on multiple servers and with only a few minutes downtime on each.  All commands are run as root to save time.


If you have any additional packages that are no longer needed, now is a good time to remove them:
apt-get autoremove
Then add the latest keys to your apt:
apt-get install debian-archive-keyring -y
wget https://ftp-master.debian.org/keys/archive-key-6.0.asc && apt-key add archive-key-6.0.asc
You'll need to "fix" the Rackspace Nova Agent to work with Squeeze, open '/etc/init.d/nova-agent' with your chosen editor and insert the following after the line '# pidfile: /var/run/nova-agent.pid':
# LSB style init header:
# Provides: Nova-Agent
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start nova-agent at boot time
# Description: nova-agent is a guest agent for OpenStack nova.
Next update your apt sources to match the new version of debian, again with your chosen editor open '/etc/apt/sources.list' and change any mentions of 'lenny' to 'squeeze'.  Here is an example sources.list, change the localised sources to somewhere nearer you:
deb http://ftp.uk.debian.org/debian/ squeeze main
deb-src http://ftp.uk.debian.org/debian/ squeeze main
deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main
# squeeze-updates, previously known as 'volatile'deb
http://ftp.uk.debian.org/debian/ squeeze-updates main
deb-src http://ftp.uk.debian.org/debian/ squeeze-updates main

Run the distribution upgrade

We're now into the meat of the process, this should be fairly painless.  Update your apt to use the new sources you just set, do another package cleanup just in case and prepare for the upgrade:
apt-get update
apt-get autoremove
apt-get install apt dpkg
apt-get install locales
Now run the full upgrade, this will take some time and ask you a few questions, unless you have a specific reason not to, accept the defaults.
apt-get dist-upgrade
This will have updated you to Squeeze, but your MySQL install will likely not work, so we need to upgrade to 5.1, however in Oracle's infinite wisdom, they have made a parameter in the 5.0 default config cause your server not to start.  With your editor open '/etc/mysql/my.cnf' and look for the line 'skip-bdb' and either comment out or remove entirely.  Not run the upgrade to 5.1:
apt-get install mysql-server-5.1

All done

That should be it and you are now running MySQL 5.1 and Debian 6.  In our tests, the whole process took around 13-15 minutes with only 8 of those having the MySQL server down.
comments powered by Disqus
Support Ticket
Remote Support
clever girl