HowTo: Upgrade Debian 5.0 (Lenny) To Debian 6.0 (Squeeze)

Debian 6.0 “Squeeze” has been released and how do I upgrade to Debian GNU/Linux 6.0 from the previous release, Debian GNU/Linux 5.0 (“Lenny”) using command prompt?

Debian 6.0 introduces a dependency based boot system, making system start-up faster and more robust due to parallel execution of boot scripts and correct dependency tracking between them. Upgrades to Debian GNU/Linux 6.0 from the previous release, Debian GNU/Linux 5.0 (codenamed “Lenny”), are automatically handled by the apt-get package management tool for most configurations.

Make a backup – it cannot be stressed enough how important it is to make a backup of your system before you do this. Most of the actions listed in this post are written with the assumption that they will be executed by the root user running the bash or any other modern shell. The official Debian document recommends:

The main things you’ll want to back up are the contents of /etc, /var/lib/dpkg, /var/lib/apt/extended_states and the output of dpkg –get-selections “*” (the quotes are important). If you use aptitude to manage packages on your system, you will also want to back up /var/lib/aptitude/pkgstates.

The following insutctions are tested on 64 bit version only but should work with 32 bit system. Edit the file called /etc/apt/sources.list, enter:
# vi /etc/apt/sources.list
Find word lenny and replace with squeeze. At the end it should look as follows:

deb squeeze main
deb-src squeeze main

deb squeeze/updates main
deb-src squeeze/updates main

deb squeeze/volatile main
deb-src squeeze/volatile main

Save and close the file. Type the following command:
# apt-get update
# apt-get install apt dpkg aptitude
# apt-get dist-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

Further readings:

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 7 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
7 comments… add one
  • j Feb 7, 2011 @ 13:11

    awesome. seems easy enough. thanks

  • themill Feb 8, 2011 @ 0:31

    Please base your upgrade instructions on the release notes. The instructions there were written based on a lot of different upgrade tests with a lot of different configurations — upgrading kernel and udev is believed to be important by the udev maintainer; upgrading apt separately has no benefit in this release cycle so may as well be skipped etc.

    There’s also a lot more to a clean upgrade than what you have written, particularly with the migration to insserv.

  • Paul Rogalinski Feb 13, 2011 @ 12:11
  • Philipp Feb 16, 2011 @ 3:22

    deb squeeze-updates main
    Instead of volatile…

  • Wally Feb 22, 2011 @ 14:44

    It can still be a tricky business. Deb32 Gnome is my main sys, also I run many others. I upgraded my laptop to Squeeze, carefully following all recommendations. This was my trial before doing my main desktop and it went perfectly.
    Several days later I did my desktop, and it blew up. I spent the next couple days reinstalling and restoring. You just never know. Backup!!

  • Matty Apr 15, 2011 @ 1:28

    Well, I thought it’d work, since I had a “minutes-fresh” vanilla install of 5.0 and no CD for 6.0.

    What a Nightmare!!! I’ll never use this method again.

    The repositories that Debian automatically decided to use kept giving me “hash sum errors” and midway through upgrade had to perform several “apt-get -f installs”, “dpkg –configure -a”s and had to manually download several packages with w3m via command-line. (sob)

    I strongly advise against this method, at least for 32-bit i386, which is what I’m on.

    As it is I AM in gnome finally, albeit a scaled down version and still scratching m,y head as to what exactly could have happened to kill so many packages from being installed.

    Thanks anyhow.

    • Anders May 2, 2011 @ 10:36

      Upgrade works fine, if you follow the official instructions from and use official repositories.
      You need to do a minimal upgrade first, then upgrade kernel and udev, reboot and then ordinary dist-upgrade. Do remove all external repositories before you start, for instance when you rename distribution in sources.list

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum