≡ Menu

Debian Linux: Upgrade v6.0.x Squeeze to v7.0.0 Wheezy

Recently Debian Linux version 7.0 ("Wheezy") released. This version shipped with many new features - improvements to multimedia support, improved security through hardening flags and the OpenStack suite and the Xen Cloud Platform to name a few. How do I upgrades from Debian Linux version 6.x.x (squeeze) to the latest version 7.0.0 wheezy using command line options? How do I upgrade my Debian 6.x server to 7.x over the ssh session?

Tutorial details
DifficultyAdvanced (rss)
Root privilegesYes
RequirementsInternet+Debian 6.x.x
Estimated completion timeN/A

First things first

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 (see the references section below for more info):

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 upgrade process itself does not modify anything in the /home directory. However, some applications (e.g. parts of the Mozilla suite, and the GNOME and KDE desktop environments) are known to overwrite existing user settings with new defaults when a new version of the application is first started by a user. As a precaution, you may want to make a backup of the hidden files and directories (“dotfiles”) in users' home directories. This backup may help to restore or recreate the old settings. You may also want to inform users about this.

The following instructions 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 squeeze and replace with wheezy. At the end it should look as follows:

 
deb http://mirrors.kernel.org/debian/ wheezy main
deb-src http://mirrors.kernel.org/debian/ wheezy main
 
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main
 
# wheezy-updates, previously known as 'volatile'
deb http://mirrors.kernel.org/debian/ wheezy-updates main
deb-src http://mirrors.kernel.org/debian/ wheezy-updates main
 

To update the package list, enter:
# apt-get update

To update the minimal base system, enter:
# apt-get upgrade

To upgrade the rest of the system, enter:
# apt-get dist-upgrade

Reboot the system:
# reboot

Verify your system, type:
$ lsb_release -a
Sample outputs:

No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 7.0 (wheezy)
Release:	7.0
Codename:	wheezy

Check the kernel version, enter:
$ uname -mrs
Sample outputs:

Linux 3.2.0-4-amd64 x86_64

Also, check log files for error:
# tail -f /var/log/messages
# egrep -i --color 'err|warn|crit' /var/log/fileName

References:
Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 9 comments… add one }

  • a May 5, 2013, 7:44 pm

    U mean apt-get update when you say
    “To update the package list, enter:”

  • Patschi May 8, 2013, 1:33 am

    In the last sources.list entry there is missing an “n” at the end:
    “deb-src http://mirrors.kernel.org/debian/ wheezy-updates mai__n__”

  • chris J May 8, 2013, 3:38 am

    I run testing, and noted that upgrading to Jessie (latest testing, removes Less). Seems to be an issue with the version of man-db not working with it.
    sudo apt-get install less
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    The following packages were automatically installed and are no longer required:
    libelf1 librpm3 librpmbuild3 librpmio3 librpmsign1 lsb-security pax rpm
    rpm-common rpm2cpio
    Use ‘apt-get autoremove’ to remove them.
    The following packages will be REMOVED:
    alien debhelper gnome-user-guide google-earth-stable lsb-core man-db yelp
    The following NEW packages will be installed:
    less
    0 upgraded, 1 newly installed, 7 to remove and 0 not upgraded.
    Need to get 134 kB of archives.
    After this operation, 164 MB disk space will be freed.
    Do you want to continue [Y/n]? n

  • Sławek June 28, 2013, 9:15 am

    After doing exactly what You said i still have in /etc/debian_version entry that states version is 6.0.7 . What could possibly go wrong?

  • bravo_kernel July 27, 2013, 5:34 pm

    Excellent tutorial Mr. Nix, just upgraded without any hickups.

    Much obliged !

  • Rob G November 4, 2013, 5:14 pm

    Thank you from a new Linux/Debian user. Worked a treat.

    Now if only my MS products were as simple to upgrade………

  • Hukup December 30, 2013, 5:15 pm

    What’s really annoying is this LSB tag stupidity what they put into debian. The upgrade broke multiple times because of my custom written init scripts which did not have this in it.
    Although Debian is still far more clean than Ubuntu, it’s going to the wrong direction.
    There is no need to change a system which was working.

    During the upgrade nvidia driver segfaulted a lot, although I didn’t lose my display:

    3b8 error 4 in libnvidia-tls.so.310.44[b76f6000+3000]
    [ 9478.022910] nvidia-settings[23822]: segfault at 6703878e ip b77c9caa sp bfa449c8 error 4 in libnvidia-tls.so.310.44[b77c9000+3000]
    [ 9483.011879] nvidia-settings[24190]: segfault at 6b67ac4b ip b7767caa sp bff8c308 error 4 in libnvidia-tls.so.310.44[b7767000+3000]
    [ 9487.995471] nvidia-settings[24577]: segfault at 2daab55c ip b76eecaa sp bfed7fe8 error 4 in libnvidia-tls.so.310.44[b76ee000+3000]
    [ 9492.984190] nvidia-settings[24675]: segfault at 2d45200a ip b76e9caa sp bf8c3578 error 4 in libnvidia-tls.so.310.44[b76e9000+3000]
    [ 9498.107357] nvidia-settings[24796]: segfault at 509c62f4 ip b777ecaa sp bfdb4318 error 4 in libnvidia-tls.so.310.44[b777e000+3000]
    [ 9503.085028] nvidia-settings[24875]: segfault at fa2fbca2 ip b7775caa sp bfb63808 error 5 in libnvidia-tls.so.310.44[b7775000+3000]
    [ 9508.075097] nvidia-settings[24894]: segfault at a14d4173 ip b7728caa sp bff28a88 error 4 in libnvidia-tls.so.310.44[b7728000+3000]
    [ 9513.060974] nvidia-settings[25050]: segfault at e284f452 ip b76fecaa sp bfb724f8 error 5 in libnvidia-tls.so.310.44[b76fe000+3000]
    [ 9518.048998] nvidia-settings[25165]: segfault at 45a5d7fe ip b77b3caa sp bfd08db8 error 4 in libnvidia-tls.so.310.44[b77b3000+3000]
    [ 9523.034432] nvidia-settings[25268]: segfault at e7ba7d4a ip b7701caa sp bfe174e8 error 5 in libnvidia-tls.so.310.44[b7701000+3000]

  • Patrick van Efferen October 15, 2014, 9:31 am

    Great tutorial, works like a charm! Thanks

Leave a Comment