Jackl0phty's Blog

Rants, tirades, and sporadic outbursts from 'the Linux guy'.

Howto: Upgrade From Debian Squeeze to Wheezy

| Comments

This blog post will discuss how to upgrade from Debian squeeze to wheezy.

We’ll start by cleaning a few things up.

Clear out local repository of retrieved package files no longer needed
1
apt-get autoclean
Remove packages no longer needed
1
apt-get autoremove

Now let’s search for packages that have been installed only partially and fix them.

Fix any packages in the output of the dpkg cmd below
1
dpkg --audit

Now make sure no packages are on hold like so:

Fix any packages that may be on hold
1
dpkg --get-selections | grep hold

If you receive no output from the two dpkg commands above it should be safe to start the upgrade.

Update your source list located at /etc/apt/sources.list. If you’re not on squeeze then substitute ‘squeeze’ with the version you’re on.

Use sed to edit your list of sources
1
sed -i 's/squeeze/wheezy/g' /etc/apt/sources.list

Your source list at /etc/apt/sources.list should now look something like the following:

New source list pointing at wheezy repos
1
2
3
4
5
6
7
8
9
10
11
server1:~# cat /etc/apt/sources.list
deb http://ftp.us.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.us.debian.org/debian/ squeeze main contrib non-free

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://ftp.us.debian.org/debian/ squeeze-updates main contrib non-free
deb-src http://ftp.us.debian.org/debian/ squeeze-updates main contrib non-free
server1:~#

Note: Your URLs will likely differ from mine; especially if you don’t live in the US.

Now let’s resynchronize your package index files from the new sources that point to Wheezy.

Resynchronize package index files via apt-get update
1
server1:~# apt-get update

Next install the newest versions of all packages currently installed on the system according to /etc/apt/sources.list.
Note: This is pretty much the point of no return!

Install the newest versions of all packages currently installed
1
server1:~# apt-get upgrade

Now actually upgrade your current Debian distribution. Apt-get dist-upgrade will perform the same as upgrade and intelligently handle changing dependencies with new versions of packages.

Upgrade your Debian distribution
1
server1:~# apt-get dist-upgrade

Now reboot.

Reboot into your new Debian distribution Wheezy
1
server1:~# init 6

After logging back into your Debian box let’s check for package issues like we did before.

Fix any packages these two commands output
1
2
server1:~# dpkg --audit 
server1:~# dpkg --get-selections | grep hold

You may need to do the upgrade dist-upgrade song-and-dance one final time.

Do a final upgrade
1
2
server1:~# apt-get upgrade 
server1:~# apt-get dist-upgrade

Finally check what Debian version you’re currently on.

Check your Debian version
1
2
3
server1:~# cat /etc/debian_version 
7.0
server1:~#

If the output of the above command is 7.0 you are now running Debian Wheezy!

Now go have a beer or three!

Comments