Upgrade Debian 6 Squeeze to 7 Wheezy
Debian 7 (Wheezy) is the most recent stable version of Debian Linux, released in May 2013. This guide explains how to upgrade your system from Debian 6 (Squeeze) to Debian 7.
These steps can be preformed as an in place upgrade on a live system from either a local terminal or SSH session to a remote system.
Step 1
Prior to upgrading, make sure the current system is up-to-date.
apt-get update && apt-get upgrade
Step 2
Begin the upgrade by switching Debian repositories from Squeeze to Wheezy. This is accomplished in one of two ways; using the sed command to search and replace all instances automatically, or by editing the source file manually. Choose whichever option you prefer.
Search & Replace with sed.
sed -i 's/squeeze/wheezy/g' /etc/apt/sources.list
Or edit your source list manually.
vi /etc/apt/sources.list
Replace all instances of "squeeze" with "wheezy", for example.
deb http://debian.osuosl.org/debian squeeze main non-free contrib deb-src http://debian.osuosl.org/debian squeeze main non-free contrib deb http://security.debian.org/ squeeze/updates main contrib non-free deb-src http://security.debian.org/ squeeze/updates main contrib non-free # squeeze-updates, previously known as 'volatile' deb http://debian.osuosl.org/debian squeeze-updates main contrib non-free deb-src http://debian.osuosl.org/debian squeeze-updates main contrib non-free
Becomes.
deb http://debian.osuosl.org/debian wheezy main non-free contrib deb-src http://debian.osuosl.org/debian wheezy main non-free contrib deb http://security.debian.org/ wheezy/updates main contrib non-free deb-src http://security.debian.org/ wheezy/updates main contrib non-free # wheezy-updates, previously known as 'volatile' deb http://debian.osuosl.org/debian wheezy-updates main contrib non-free deb-src http://debian.osuosl.org/debian wheezy-updates main contrib non-free
Note: Your source list may or may not contain supplemental packages from contrib and non-free archives.
Step 3
Update the package index.
apt-get update
Step 4
Upgrade the minimal base system.
apt-get upgrade
Step 5
Upgrade all other packages and dependencies.
apt-get dist-upgrade
Step 6
Reboot the system.
reboot
Step 7
Verify your release is now Debian 7.
lsb_release -a
Output will be similar to this.
No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 7.0 (wheezy) Release: 7.0 Codename: wheezy
Step 8
Verify Kernel version.
uname -mrs
Output will be similar to this.
Linux 3.2.0-4-amd64 x86_64
Step 9
Optionally, free up some disk space by clearing the local repository of retrieved package files.
apt-get clean
apt-get autoremove