Saturday, February 28, 2009

HowTo upgrade from Debian Etch (4.0 ) to Lenny (5.0)

Debian Lenny’s release is getting closer and closer and many people will want to upgrade their Etch servers to Lenny.This is currently in testing so it is not recommended to use these instruction in production.

Before Upgrade

Take a complete backup of your debian etch server

Procedure to follow

First you need to take a backup of your sources.list file using the following command

#cp /etc/apt/sources.list /etc/apt/sources.list.backup

Now edit the /etc/apt/sources.list file

#vi /etc/apt/sources.list

Now you need to replace “etch” with “lenny“.

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

The above example is for a system using the main UK mirrors; your file might use a different local one

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.We 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.

Perform upgrade

After changing apt sources we need to update source list using the following command

#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

Note:-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.

No comments: