Sat 21 Mar 2009
How to upgrade Debian Etch to Lenny
Posted by Kris under Tech
[2] Comments
I finally decided to take the plunge and upgrade a few of my Etch servers to Lenny, and the process was a lot less painful than I was expecting.
These are basically the steps from the official manual, but I cant guarantee that your system will upgrade as easily as mine – as always when upgrading you should backup your data and be prepared for the worst.
Usually I prefer apt-get over aptitude, but the official documentation recommends aptitude to do the upgrade, so heres what you need to do (as root)
First, edit /etc/apt/sources.list and change all mentions of etch to lenny. If you use vim, you can simply do the following:
vim /etc/apt/sources.list
(then, in vim)
:%s/etch/lenny/g
:wq
Then update…
aptitude update
At this point, you might receive the following error (I did on every server I upgraded)
W: There is no public key available for the following key IDs:
4D270D06F42584E6W: You may want to run apt-get update to correct these problems
To fix this, you need to install the following:
aptitude install debian-archive-keyring
aptitude update
Now you’re ready to do the upgrade. The safest way to do this is in 3 parts
aptitude install aptitude
(updating apt first is a safe way of doing things)
aptitude upgrade
(when this finishes)
aptitude dist-upgrade
When this has finished, your system is upgraded to Lenny! All you need to do now is reboot, and hopefully the system will come back up and be running Lenny.








The official upgrade documentation can be found here:
http://www.debian.org/releases/stable/i386/release-notes/ch-upgrading.en.html
The most recent upgrades I’ve done have errored with the following:
dpkg: error processing /var/cache/apt/archives/mount_2.13.1.1-1_amd64.deb (–unpack):
at the dist-upgrade stage.
I’ve found that the way around it is to unmount any nfs and samba mounts (or any non local drives), and do ‘aptitude dist-upgrade’ again.