Sunday, February 22, 2009

Ubuntu: Upgrading from Fiesty to Gutsy

A few weeks ago, I decided to upgrade a couple of Ubuntu machines to the latest version. Now, this needs to be done incrementally. You can't just upgrade to the latest version. Step one is to upgrade from Feisty to Gutsy. It turns out that at this point (Feb 2009), it's a bit tricky to do this because it's hard to find the source files online. However, they have been archived. You just need to know where to find them.

The first step is to update /etc/apt/sources.list to the following:

deb http://old-releases.ubuntu.com/ubuntu/ feisty main universe
deb http://old-releases.ubuntu.com/ubuntu/ feisty-backports universe main
deb http://old-releases.ubuntu.com/ubuntu/ feisty-security universe main
deb http://old-releases.ubuntu.com/ubuntu/ feisty-updates universe main
deb http://old-releases.ubuntu.com/ubuntu/ feisty-proposed universe main


After I did this, I could run the following commands:

sudo aptitude update
sudo aptitude upgrade
sudo aptitude dist-upgrade
sudo aptitude install update-manager-core
sudo do-release-upgrade


However, the process had some errors. Some packages failed to download because, for some reason, the update-manager would insert an invalid URL into the sources list. Turns out this is a known issue.

I got around this by using the tip posted here. The site which I couldn't prevent from being checked for downloads (us.archive.ubuntu.com) did not have the files that I needed. I Googled the URL (minus domain name) find the URL elsewhere. After a few tries, I found that the following site had the files:

http://mirror.csociety.org/ubuntu/dists/feisty-backports/main/debian-installer/binary-i386/

I checked to see if this address could be fetched with an IP number:

Macintosh-7:~ olaf$ host mirror.csociety.org
mirror.csociety.org is an alias for csociety-ftp.csociety.org.
csociety-ftp.csociety.org has address 128.46.156.117


Now, armed with the IP, I tried the link:

http://128.46.156.117/ubuntu/dists/feisty-backports/main/debian-installer/binary-i386/

It worked! Almost there. Now, I needed to send all requests for us.archive.ubuntu.com to this address. So, I edited my /etc/hosts file and added the following line:

128.46.156.117  us.archive.ubuntu.com


Now, when I tried to run the release steps the correct packages were fetched, but I got a new error:

"While scanning your repository information no mirror entry for the upgrade was found"

I found the fix to this error here: http://andreasjacobsen.com/2008/12/

After fixing my /etc/apt/sources.list as described in this article, do-release-upgrade ran without complaints and I'm upgrading as we speak. :)