HowTo: Upgrade Ubuntu to the next version without burning a physical CD.

As you are probably aware, Ubuntu has a regular six-month release cycle, and if you are someone like me, then you are probably regularly downloading all the Alpha and Beta versions as well as the final releases. The problem with such regularity is that this would use up an awful lot of blank CD’s that you will probably only use a few times before discarding just to install these upgrades.

Fortunately, you don’t have to burn Ubuntu CD ISO images to a physical disc to upgrade your installation to the next version. Here’s how to do it using just the ISO image, or wholly via the Internet with no ISO image or CD at all.

There are three ways to upgrade Ubuntu from one version to the next:

  • Wholly on-line via the graphical Update Manager application, or
  • Wholly on-line via command line Apt application, or
  • The quicker and more easily repeatable method of using an upgrade CD, especially if installing multiple machines (this process optionally will also retrieve additional updates from the Internet released since the CD’s initial release). I will outline all three methods here.

NOTE: You cannot upgrade one CPU architecture to another, ie: you cannot upgrade Ubuntu 8.04 x86 (32-bit Intel/AMD compatible) to Ubuntu 8.10 AMD64 (64-bit Intel/AMD compatible), etc. If you previously used the 32-bit version of Ubuntu and wish to upgrade to the 64-bit version, you will need to do a complete fresh installation from scratch.

Upgrading via the CD ISO image

First up, you will need to download the Alternate Installer CD ISO image of the new version of Ubuntu you want as opposed to the Desktop Live CD version, which cannot do upgrades. All Ubuntu Alternate discs are named in the format of ubuntu-x.xx-alternate-yyyy.iso where x.xx is the release version, eg: 8.10 or 9.04, and yyyy is the target architecture, eg: amd64 for 64-bit Intel-compatible platforms and i386 for 32-bit Intel-compatible platforms. Thus the Ubuntu Intrepid 8.10 64-bit version is called ubuntu-810-alternate-amd64.iso and when it’s eventually released, the Ubuntu Jaunty 9.04 64-bit version will be called ubuntu-9.04-alternate-amd64.iso accordingly.

Once you have the CD image downloaded, make a note of where you downloaded it to, eg: /home/jbloggs/downloads/ubuntu-8.10-alternate-amd64.iso and then jump into a terminal window.

Make sure that you do not have any actual physical CD’s inserted into your CD-ROM drive.

At the $ prompt type in:

$ sudo mount -o loop /home/jbloggs/downloads/ubuntu-8.10-alternate-amd64.iso /media/cdrom

…and hit Enter. If all is well, it should look as though nothing happened, however you will notice a CD icon appear on your desktop simply called “cdrom”.

Now start the upgrade process with the following command:

$ gksu /media/cdrom/cdromupgrade

…and then just follow the prompts. When you reboot after the upgrade, the CD image will no longer be mounted and you can use real CD’s again without any issue.

Upgrading via the Internet only – GUI installation

This method is possibly more convenient, but generally takes longer to do and is not the ideal way to upgrade multiple machines. Using this method, you don’t need the ISO image at all. Everything is handled by the Update Manager.

Open a terminal (or press ALT + F2 to bring up the Run Application dialog) and type in the following:

gksu "update-manager -d" 

…and hit Enter. This will launch the familiar Update Manager. If you are not immediately advised of a newer version of Ubuntu to upgrade to, as illustrated below, then click on the “Check” button to update your system’s cache of available updates, then click on the “Upgrade” button that appears at the top.

Before Update Manager is aware of the next distribution version:

Update Manager now showing the Upgrade option

And after Update Manager is made aware of the next distribution version by clicking on the “Check” button (note that the Upgrade option will NOT appear if you did not start Update Manager with the “-d” parameter):

Update Manager showing the Upgrade button

Follow the prompts.

Upgrading via the Internet only – Command Line installation

This method is identical to the GUI Update Manager installation, except that it is done wholly via the command line using Apt.

First of all, make sure that Apt is fully up to speed with current updates by jumping into a terminal and type in at the $ prompt:

$ sudo apt-get update && sudo apt-get upgrade

When that has finished, commence the upgrade to the next version of Ubuntu with:

$ sudo do-release-upgrade

Follow the prompts.

That’s it!