Debian version 5.0 has been released. It is recommended that you upgrade the system to latest version. Upgrading remote Debian server is a piece of cake. In this tutorial, you will learn about upgrading Debian Linux server from Etch to Lenny over ssh session.
Step # 1: Make a Backup
Upgrading system is a complex procedure. I strongly recommend backing up all data and configuration files. The upgrade process is quite reliable, but a hardware failure in the middle of an upgrade could result in a severely damaged system, so make a full system backup.
Step # 2: Apply all etch updates
Make sure etch is up to date and all security patches including kernel installed:
# apt-get update
# apt-get upgrade
Reboot the system if new kernel installed:
Step # 3: Update /etc/apt/sources.list
Make a backup copy of /etc/apt/sources.list, enter:
# cp /etc/apt/sources.list /etc/apt/sources.list.etch
Open /etc/apt/sources.list, enter:
# vi /etc/apt/sources.list
Update it as follows (use mirror closest to your location):
# Main deb http://ftp.iitm.ac.in/debian lenny main contrib non-free deb-src http://ftp.iitm.ac.in/debian lenny main contrib non-free # Security deb http://security.debian.org/ lenny/updates main contrib non-free deb-src http://security.debian.org/ lenny/updates main contrib non-free
Save and close the file.
A note about stable /etc/apt/sources.list file
For server you should always use the following file. This file ensures that you always run stable released software. With following config, you do not need to update /etc/apt/sources.list file and you can simply run below mentioned command to upgrade system to stable release:
# Main deb http://http.us.debian.org/debian/ stable main non-free contrib # Source deb-src http://http.us.debian.org/debian/ stable main non-free contrib # Security deb http://security.debian.org/ stable/updates main contrib non-free
Step # 4: Upgrade Debian to from 4.0 to 5.0
The recommended way to upgrade from previous Debian GNU/Linux releases is to use the package management tool aptitude. This program makes safer decisions about package installations than running apt-get directly. First, upgrade the core tools aptitude and apt, enter:
# aptitude update
Now update both apt and aptitude
# apt-get install apt aptitude
# aptitude update apt aptitude
Above two commands will automatically upgrade libc6 and other support libraries. Some running services will be restarted, including ssh, rsyncd xdm, gdm and kdm etc. Now, we have updated apt and aptitude. It is time to apply system update, enter:
# aptitude upgrade
# aptitude install
Above will install required updates to the system. Finally, update entire distribution:
# aptitude dist-upgrade
Above will update the rest of the system i.e. install the newest available versions of all packages, and resolve all possible dependency changes between packages in different releases.
Step # 5: Verify your system
Type the following commands to verify kernel:
# uname -a
Linux debian.nixcraft.in 2.6.26-1-amd64 #1 SMP Sat Jan 10 17:57:00 UTC 2009 x86_64 GNU/Linux
Verify Debian version, enter:
# cat /etc/debian_version
Verify log files, enter:
# egrep -i 'err|warn' /var/log/dmesg
# egrep -i 'err|warn' /var/log/messages
# tail -f /var/log/dmesg
# tail -f /path/to/other/apps/log
Verify running service and open ports, enter:
# netstat -tulpn
Verify firewall settings, enter:
# iptables -L -n
# ip6tables -L -n
- man page aptitude, apt and other commands.
- Above instructions are tested on 64bit and 32bit server system only. I strongly recommend official release note for further information.