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.
server1:~# apt-get autoclean
- Remove packages no longer needed.
server1:~# apt-get autoremove
- Now search for packages that have been partially installed and fix them. Fix any packages in the output of the following cmd.
server1:~# dpkg --audit
- Now make sure no packages are on hold.
server1:~# 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 APT sources.
server1:~# 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:
- Confirm new source list is pointing at wheezy repos.
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.
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.
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.
server1:~# apt-get dist-upgrade
- Now reboot.
server1:~# init 6
After logging back into your Debian box let’s check for package issues like we did before.
- Fix any packages this dpkg command outputs.
server1:~# dpkg --audit
You may need to do the upgrade dist-upgrade song-and-dance one final time.
- Do a final upgrade.
server1:~# apt-get upgrade
server1:~# apt-get dist-upgrade
Finally check what Debian version you’re currently on.
- Check your Debian version.
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!