Debian Lenny Upgrade
This is a short summary of the process I went through to update Debian Etch to Debian Lenny.
Preparation
Update etch to the latest available packages.
aptitude update aptitude upgrade
Read the Potential problems section in the upgrade notes. I had to update Apache2 configs.
Backup the files in /etc, /var/lib/dpkg, /var/lib/aptitude/pkgstates and the output of dpkg --get-selections "*".
Replace lilo with grub bootloader. Lilo can't handle the bigger initrd.
Make sure to process or remove any packages on hold.
dpkg --get-selections | grep hold
Clean and remove any packages stored on the disk.
apt-get clean
Upgrade to Lenny
I upgrade the system over ssh. Two sessions open will let you upgrade in one and check the updated configuration files in the other (the .dpkg-old files).
Update the apt sources.list, replace etch with lenny.
deb ftp://ftp.no.debian.org/debian/ lenny main non-free contrib deb-src ftp://ftp.no.debian.org/debian/ lenny main non-free contrib deb http://security.debian.org/ lenny/updates main contrib non-free
Start recording the upgrade session using the script utility.
script -t 2>~/upgrade-lenny.time -a ~/upgrade-lenny.script
Playback using the following command.
scriptreplay ~/upgrade-lenny.time ~/upgrade-lenny.script
Update the packages to reflect Lenny.
aptitude update
Now, install the Lenny version of apt and aptitude to avoid any problems while the upgrade runs.
aptitude install aptitude
The process will install libc6 and locales, and other dependencies. Some services will be restarted, i.e ssh, postfix, etc.
Convert the apt package sources to support the new version of apt.
aptitude search "?false"
Next, first upgrade, the minimal upgrade. This is recommended to update only packages while not removing or installing huge amount of packages that dist-upgrade would do.
aptitude upgrade
I had to update the following configurations.
/etc/bash.bashrc /etc/securetty /etc/logrotate.conf /etc/sysctl.conf /etc/smartd.conf
Then run dist-upgrade to update the rest of the packages to Lenny.
aptitude dist-upgrade
There might be some issues, either accept the proposed solution or fix the issues manually.
Finally, upgrade the kernel. Find the installed kernels using the following command.
dpkg -l "linux-image*" | grep ^ii
Find available kernel metapackages.
apt-cache search linux-image-2.6- | grep -v transition
My system had everything in order. Maybe remove some of the older kernels not used anymore.