Do you know how to upgrade you stable Debian release? I am not talking about upgrading packages, but upgrading your Debian to a new stable release when that comes around. Typical Debian installation has “sources.list” like that

deb http://ftp.si.debian.org/debian/ lenny main
deb-src http://ftp.si.debian.org/debian/ lenny main
 
deb http://security.debian.org/ lenny/updates main contrib
deb-src http://security.debian.org/ lenny/updates main contrib

It has a distrubution name (lenny for instance) in it. This insures that we cannot accidentally update it with some other version packages. But if that is not a concern and if you want go to a new stable version as it comes out just change it like this

deb http://ftp.si.debian.org/debian/ stable main
deb-src http://ftp.si.debian.org/debian/ stable main
 
deb http://security.debian.org/ stable/updates main contrib
deb-src http://security.debian.org/ stable/updates main contrib

This tells the apt installer to use the stable packages (the latest) instead of specific version of stable packages. This means that when the stable release changes, the installer will automatically use the new packages.

There is another useful technique involved called apt-pinning. Do you get annoyed sometimes because the stable release becomes outdated so fast and some packages are not available in it? Well, apt pinning changes that. It enables you to also install packages from testing and release, but favors packages in the stable release if available. Your “sources.list” should look like this:

#Stable
deb http://ftp.si.debian.org/debian/ stable main
deb-src http://ftp.si.debian.org/debian/ stable main
 
deb http://security.debian.org/ stable/updates main contrib
deb-src http://security.debian.org/ stable/updates main contrib
 
#Testing
deb http://ftp.si.debian.org/debian/ testing main
deb-src http://ftp.si.debian.org/debian/ testing main
 
#Unstable
deb http://ftp.si.debian.org/debian/ unstable main
deb-src http://ftp.si.debian.org/debian/ unstable main
 
deb http://debian.supermind.nl/ current main
deb http://debian.supermind.nl/ nightly main

As you can see this enable apt installer to read the packages from all three branches (stable, testing, unstable). You will also need a “preferences” file in apt directory, which tells apt which packages have the priority. It should look something like this

Package: *
Pin: release a=stable
Pin-Priority: 700
 
Package: *
Pin: release a=testing
Pin-Priority: 650
 
Package: *
Pin: release a=unstable
Pin-Priority: 600

This is all you need. To get more information on the subject read this great article on apt-pinning:

http://jaqque.sbih.org/kplug/apt-pinning.html

To upgrade just enter the following two commands in sequence.

apt-get update
apt-get dist-upgrade

You need to do “dist-upgrade” instead of just “upgrade” as this insures that also the new required packages are installed. This is all there is to it. For the end let me just show what to do if you need a kernel that can use more than 4GB of memory. The following commands check if bigmem is already installed and install it if not. The example is for 2.6 version of the kernel

dpkg --get-selections | grep bigmem
apt-get install linux-image-2.6-686-bigmem

Again more on the subject can be found here:

http://knowledgelayer.softlayer.com/questions/294/Debian+isn%27t+showing+all+my+ram!