HowTo upgrade from Debian Etch to Lenny

Debian Lenny’s release is getting closer and closer and many people will want to upgrade their Etch servers to Lenny, maybe even before Lenny is declared stable (at RC1 at this time). Even people that don’t want to upgrade to lenny might find some useful information in this post ;-) . One of the greatest advantages of debian over other linux distributions is that we can upgrade our systems live from one version to another (hopefully with minimal damage or impact to the running system), while other distros like rhel will not recommend their users to ever do this but to do a full new installation and migrate over their user data afterwards. Obviously it is a great advantage to be able to perform a live upgrade from one version to the other, and from my experience this has not caused problems, but even so, if this is a production server or just a system you care for and it is not for testing, I would start by making a backup of the system and be prepared in case it will no longer work after this. Just in case… Also you should start by reading the release notes of the new version and look for any incompatibilities (hardware or software) or changed things that could affect your particular setup.

1. Update apt sources.list

The first thing we will do (after the backup of course) is to edit the /etc/apt/sources.list file and replace “etch” with “lenny”. Originally, this might look like this (for a system using the main US mirrors; your file might use a different local one):

deb etch main contrib non-free
deb-src etch main contrib non-free

deb etch/updates main contrib non-free

after replacing etch with lenny the file will look like this:

deb lenny main contrib non-free
deb-src lenny main contrib non-free

deb lenny/updates main contrib non-free

WARNING: if for some reason your apt sources doesn’t use etch, but “stable” then your apt commands will start to use lenny the moment it is released. This can result in wrongfully performing the upgrade while you don’t want to do this or even upgrade by mistake. I would always recommend people to use the release name (like etch, lenny) instead of generic names (like stable, testing); this way you will have the control on when you want to upgrade.

2. Perform the actual upgrade

After changing apt sources we need to refresh the indexes, and for this we have to run:

aptitude update

Once this is done we will want to upgrade first the core apt packages:

aptitude install apt dpkg aptitude

and finally perform the full upgrade:

aptitude full-upgrade

(dist-upgrade was renamed to full-upgrade in lenny’s aptitude); or you can use: apt-get dist-upgrade

This will take a while depending on what packages you have installed (that will need to be upgraded) and on your internet connection speed. After this is done you will have to reboot your system in order to activate the kernel upgrade to the lenny 2.6.26 kernel. Also you will want to check and see that all the applications you are using are still working as expected after the upgrade.

Note: if you are using release names in your apt sources and not generic ones like “stable” your debian system will not upgrade by itself and you will have the control when you want to do this (before or after lenny is release, or even delay this as long as you need) as explained in this post; even if you don’t want to upgrade, check your apt sources and ensure it is pointing to etch so no mistakes will happen on the day lenny is released (in case your files points to stable).

comments powered by Disqus