HOWTO: Upgrade Debian Lenny (5.0) to Debian Squeeze (6.0) on VPS.net

Here are the working upgrade instructions from Lenny to Squeeze (Debian 6) on VPS.net.

Disclaimer: please test this yourself first on a NON PRODUCTION SERVER. this may or may not work with other server providers but is specifically tailored to the VPS.net system, I do not guarantee its results outside of my tested system (OnApp Cloud – LON-I from a stock Debian Lenny install).

UPDATE: VPS.net have now released Debian 6 templates on there clouds however upon testing this i have noted several issues with it and as such although it makes the install of debian 6 easier on VPS.net i am not however recommending using the Debian 6 templates that vps.net until they fix the bugs with them – the biggest problem so far is that you cant update the kernel without a fatal error which will occure everytime you use apt to run any updates (which you should be doing regularly), there are also issues with sub-optimal mirrors being selected and at least from what i can see wrong timezone by default in LON clouds. At this time because of the kernel update issue you cannot install ksplice and possibly any program that uses a shell script that interacts with apt for installing.

Other notes: Ksplice is known to work with Debian Squeeze, also despite having success on the older clouds (eg LON-C) I havent been able to document possible pitfalls with non OnApp based clouds therefore its recommended to first TEST your upgrade in any instance and/or migrate to the newer clouds if you can. I assume you can SSH in as root to your server and can handle basic file editing with nano (substitute your preferred text editor as neccesary)

Here goes:

Fully update your lenny system (recommended to avoid some possible gpg errors).

[bash]apt-get update && apt-get upgrade[/bash]

I recommend rebooting here just as a safety measure.

[bash]reboot[/bash]

Reconnect to your server then update your apt sources list.

[bash]nano /etc/apt/sources.list[/bash]

Your sources list should look not to different to the following (for UK servers) update the references appropriately to get the closest mirrors to you:

[bash]deb http://ftp.uk.debian.org/debian/ squeeze main
deb-src http://ftp.uk.debian.org/debian/ squeeze main

deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main

deb http://ftp.uk.debian.org/debian squeeze-updates main
deb-src http://ftp.uk.debian.org/debian squeeze-updates main[/bash]

Update the package lists.

[bash]apt-get update[/bash]

Install locales update (to stop lots of annoying errors while upgrading).

[bash]apt-get install locales[/bash]

Update the kernel and install udev first.

[bash]apt-get install linux-image-`uname -r|sed ‘s,[^-]*-[^-]*-,,’` udev[/bash]

WARNING: DO NOT REBOOT AFTER UPDATING THE KERNEL, CARRY ON WITH THIS GUIDE.

When asked for change to UUID’s – select NO

Now edit your /boot/grub/menu.lst and edit any reference of sda1 to xvda1 (should be 3 of them).

also edit your /etc/fstab file and change an references from sdaX to xvdaX  (should only be 2 items)

Then reboot again.

[bash]reboot[/bash]

Reconnect to your server and check your kernel version.

[bash]uname -r[/bash]

Should return something starting with 2.6.32 similar to:

[code]2.6.32-5-xen-amd64[/code]

Then the final upgrade.

[bash]apt-get dist-upgrade[/bash]

When you are asked for options.

Change to dash – doesnt matter which is chosen this can be whatever you prefer.

Chainload grub 2 – NO.

Change to dependancy based sequencing (i selected both and its fine).

Restart services just hit enter.

Reboot for good luck (isnt actually needed because kernel is already up to date but better to eliminate issues ahead of crunch time).

[bash]reboot[/bash]

Sit back and Enjoy!

Posted in HOWTO's, Tutorials
Tags: , , , , , , , ,
5 comments on “HOWTO: Upgrade Debian Lenny (5.0) to Debian Squeeze (6.0) on VPS.net
  1. nux says:

    Thanks a lot for this. It’s quite a pain messing around with this and with you being #1 in Google, a quick and useful guide is always welcome.

    Just a side note, this is also useful on any hosting provider that is based on onApp. In my case, Neosurge.

  2. nux says:

    Oh – one thing I just realized after messing around with this for a while.

    Xen takes care of the kernel, so whatever kernel related stuff that happens in the instance is irrelevant.

    I recommend you simple apt-get remove anything relating to linux-image*

    • actually with Xen you get control of the kernel so you SHOULDN’T remove the kernel, I found this out the hard way when accidentally removing a kernel from a server on vps.net i had to recover from a backup. with OpenVZ you can actually remove anything to do with linux-image because the kernel is managed wholly by the hypervisor as you in fact share the kernel on OpenVZ

  3. Do you mind if I quote a couple of your posts as long as I provide
    credit and sources back to your website? My blog is in the very same niche as yours and my visitors would genuinely benefit from a lot of the information you present
    here. Please let me know if this okay with you. Appreciate it!

1 Pings/Trackbacks for "HOWTO: Upgrade Debian Lenny (5.0) to Debian Squeeze (6.0) on VPS.net"
  1. […] recently posted on how to update Debian for vps.net servers and its intricacies, I have since been able to document the process for Rackspace and this […]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.