upgrade ubuntu to a new release
there is a simple and usually pretty good working method to upgrade from an old ubuntu release to the next newer release. you can’t or shouldn’t jump releases though .. so if you have not switched releases during more than one release cycle you need to do the folowing procedure several times. i did an upgrade from feisty to gutsy to hardy on a running webserver remotly through ssh and it worked like a charm
login as root and then:
apt-get install update-manager-core
do-release-upgrade
woooooowwww that was simple
and i thaught apt-get dist-upgrade was easy
a little addon…
upgrading from an old unsupported ubuntu release
okay, you got me.. i didn’t upgrade an old feisty installation in time and now it’s not supported anymore and my ch.archive.ubuntu.com doesn’t contain those feisty packages anymore..
in order to start the upgrade or to keep working with that old ubuntu version, you can simply replace all ch.archive.ubuntu.com (or whatever your archive server is) with old-releases.ubuntu.com in the /etc/apt/sources.list file.
this can be achieved like so:
sudo su
cd /etc/apt/
sed 's/ch.archive/old-releases/' sources.list >sources.list.new
cp sources.list sources.list.old
cp sources.list.new sources.list
apt-get update
now start with the update as described above. during the process it should somewhen stop an tell you, that it couldn’t find the new repository because you are probably using your own. it then asks you if it should rewrite sources.list anyway.
at this point switch to a second console (locally ALT + F2 for example, from remote: just login from a second window) and copy your original sources.list file back
sudo cp /etc/apt/sources.list.old sources.list
now go back to the updater window and choose “y” for yes.
from now on it should continue normally and your system should update just as smoothly as any supported system would.