How to Upgrade Debian Lenny (5.0) to Squeeze (6.0)

It is wise to uninstall packages from third-party sources or those that were manually installed via a .deb to prevent possible conflicts and related issues.

To begin, edit /etc/apt/sources.list and change all occurrences of lenny to squeeze. A quick vi macro if you use it would be %s/lenny/squeeze/g. Once finished, you file should look similar to the one below.

# main repo
deb http://ftp.debian.org/debian/ squeeze main
deb-src http://ftp.debian.org/debian/ squeeze main
deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main

Next we'll update the package lists:

apt-get update

Before we can finish with the dist-upgrade, we need to update core system utilities that will be used during the dist-upgrade.

apt-get install apt dpkg aptitude

Finally, once this has completed, the following command will complete the software update part of the task:

apt-get dist-upgrade

This will bring all of your system and installed packages up-to-date with the current release of Squeeze. Any third-party .debs installed from non-standard sources or by hand will need to be updated/reinstalled manually.

Installation Notes

The installer will ask you if you want to use Dash, and unless you have a compelling reason not to, we recommend you choose to use it.

Any service restart prompts during the process are normal and typically take less than a few seconds. If an error is detected, the installer will attempt to fix it for you, or provide the error. It will typically restart SSH as well, but do not fret, it will keep your session active!

VPS Users

There is no need to make any kernel or grub-related changes unless you are explicitly running a pv-grub kernel (hint: most users are not), and in fact neither of these need to be installed. When the installer asks you about these (such as grub install devices), you can just skip/breeze right through them.

Squeeze does not appear to boot properly on 2.6.18 kernels, so ensure that you have selected a 2.6.3x or newer kernel.

Reboot your VPS as normal to bring it up on the new kernel and make sure all of your services started OK!