HowTo: Upgrade Debian Lenny to Squeeze

Posted on in Categories last updated January 15, 2011

How do I upgrade Debian stable Linux (Lenny) server to Squeeze for the testing purpose using command line options?

You need to edit the file called /etc/apt/sources.list, enter:
# vi /etc/apt/sources.list
Find word lenny and replace with squeeze. A quick find and replace can be used as follows:

WARNING! Make a backup – it cannot be stressed enough how important it is to make a backup of your system before you do this.

:%s/lenny/squeez/g
See UNIX / Linux: vi / vim perform search and replace operation for more information.

At the end it should look as follows:

deb http://ftp.us.debian.org/debian/ squeeze main
deb-src http://ftp.us.debian.org/debian/ squeeze main

deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main

deb http://volatile.debian.org/debian-volatile squeeze/volatile main
deb-src http://volatile.debian.org/debian-volatile squeeze/volatile main

Save and close the file.

Debian Linux: Update From Stable/Lenny to Ttesting/Squeeze

Type the following command:
# apt-get update
# apt-get install apt dpkg aptitude
# apt-get dist-upgrade

OR
# aptitude update
# aptitude install apt dpkg aptitude
# aptitude full-upgrade

Finally, reboot the server:
# reboot
After reboot make sure all required ports are open and all services are running:
# lsb_release -a
# netstat -tulpn
# tail -f /var/log/messages
# tail -f /path/to/log/file

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

3 comment

  1. There is a syntax error in string: “:%s/lenny/squeez/g”
    P.S. This comment must be deleted after correction. ;)

  2. Really good article describing the importance of always ensuring a complete backup of the system. We will update our servers from Lenny to Squeeze
    soon.

Comments are closed.