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

See all Debian/Ubuntu Linux related FAQ
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
Difficulty level Advanced
Root privileges Yes
Requirements Internet+Debian 6.x.x
Est. reading time 3 minutes

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 wheezy main
deb-src wheezy main
deb wheezy/updates main
deb-src wheezy/updates main
# wheezy-updates, previously known as 'volatile'
deb wheezy-updates main
deb-src 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


🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

11 comments… add one
  • a May 5, 2013 @ 19:44

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

    • 🛡️ Vivek Gite (Author and Admin) nixCraft May 5, 2013 @ 20:30

      Thanks for the heads up!

  • Patschi May 8, 2013 @ 1:33

    In the last sources.list entry there is missing an “n” at the end:
    “deb-src wheezy-updates mai__n__”

  • chris J May 8, 2013 @ 3:38

    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:
    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 Jun 28, 2013 @ 9:15

    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 Jul 27, 2013 @ 17:34

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

    Much obliged !

  • Rob G Nov 4, 2013 @ 17:14

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

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

  • Hukup Dec 30, 2013 @ 17:15

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

  • Patrick van Efferen Oct 15, 2014 @ 9:31

    Great tutorial, works like a charm! Thanks

  • Alon Or Dec 23, 2015 @ 6:46

    By following your instructions I was able to create an Hyper-v VM with support for non-legacy network adapter, you can “lsmod | grep hv” and see the hyper-v modules loaded (hv_vmbus, hv_netvsc, hv_blkvsc, hv_storvsc), connect your non-legacy network adapter and do “ip link show” then you’ll see it (you can be sure by checking the MAC).
    But why stay there?, now you can go to Debian 8 (jessie) by following the same instructions but this time use “jessie” on your sourcelist.
    I wasn’t able to go directly from 6 to 8.
    If you have trouble with “public key is not available” then follow instructions from here.

    When running on Hyper-v it throws two errors:
    Error: Driver ‘pcspkr’ is already registered
    SMBus base address uninitialized – upgrade bios or use force_addr=0xaddr

    to get rid of those errors just blacklist two modules by:
    echo ‘blacklist pcspkr’ >> /etc/modprobe.d/fbdev-blacklist.conf
    echo ‘blacklist i2c_piix4’ >> /etc/modprobe.d/fbdev-blacklist.conf

    then do:
    update-initramfs -u

    Thank You.

  • MrBadNews Apr 16, 2016 @ 10:28

    If you are using non-free drivers, and doing this upgrade by ssh, like me for firmware-bnx2, also add non-free repository to your sources.list, otherwise you can have a remote box that will not come online anymore…
    like this:
    deb wheezy main non-free
    deb-src wheezy main non-free

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.