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).

apt-get update && apt-get upgrade

I recommend rebooting here just as a safety measure.

reboot

Reconnect to your server then update your apt sources list.

nano /etc/apt/sources.list

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:

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

Update the package lists.

apt-get update

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

apt-get install locales

Update the kernel and install udev first.

apt-get install linux-image-`uname -r|sed 's,[^-]*-[^-]*-,,'` udev

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.

reboot

Reconnect to your server and check your kernel version.

uname -r

Should return something starting with 2.6.32 similar to:

2.6.32-5-xen-amd64

Then the final upgrade.

apt-get dist-upgrade

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).

reboot

Sit back and Enjoy!

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

  1. Pingback: HOWTO: Upgrade Debian Lenny (5.0) to Debian Squeeze (6.0) on Rackspace Cloud Servers

  2. nux

    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.

    Reply
  3. nux

    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*

    Reply
    1. Anthony Somerset Post author

      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

      Reply
  4. best wordpress hosting UK

    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!

    Reply

Leave a Reply

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