Upgrading to Ubuntu 9.04 from the command line 2

Posted by bikethetam Sat, 25 Apr 2009 22:49:00 GMT

For situations where no graphical interface is available or when a remote installation is needed, the command-line distribution upgrade tool of Ubuntu can come very handy.  First you need to make sure the update-manager-core package is present (it probably already is)

sudo apt-get install update-manager-core

Then all you need to do is run

sudo do-release-upgrade

If this command is run from an ssh session I highly recommend to run it inside of screen so that the upgrade won't stop in the middle of nowehere when the ssh connection is lost. And be sure that the ssh connection will be lost at some point during the installation of the packages.

When you get back physical access to the computer, go to the console, 'screen -r' to get the upgrade prompt and answer the questions it still needs an answer for.

Note that this is NOT the recommended way for upgrades. In my case, after getting access back to the computer, towards the end of the installation the display went completely black with no way of recovering it and I had to blindly reboot the machine assuming the upgrade was finished. It turned out the upgrade did actually succeed but I might just have been lucky.

Note: this was tested for the intrepid to jaunty upgrade.

Thanks to sysblogd and lair.moria.org for pointing me into the right direction.