Upgrading Ubuntu Server to 11.04 using SSH

This entry was posted by on Thursday, 28 April, 2011 at

I run a server at home (see NAS: Ubuntu Server on Intel ATOM) to, among many other tasks, backup the websites I run (see Backup your website using curlftpfs and rsync). Running at a meager 35watts, I figured there’s room for improvement. And there is, as Ubuntu 11.04 with Linux 2.6.38-8-server kernel is supposedly more energy-efficient. This morning 11.04 became available and I wanted to do a dist-upgrade. Problem: I was at work. Luckily, SSH helps here!

A dist-upgrade used to be a hassle many years ago. Luckily, over the past few years my (K)Ubuntu upgrades never caused any serious trouble. In fact, it can even be done remotely!

Step 1:

SSH to your machine, and make sure you have the update-manager-core package installed:

sudo apt-get install update-manager-core

Step 2:

Start the upgrade:

sudo do-release-upgrade -d

The installer will detect you are using SSH and will start a secondary SSH server on a different port – just in case the upgrade causes the first one to crash. I connect through an ADSL router using port forwarding, so enabling port forwarding for this port for the duration of the upgrade is a good idea.

Step 3:

After the usual questions regarding removal of packages and replacing of configfiles, the system needs to reboot. You loose your SSH connection and now it is time to keep your fingers crossed. The system will go through GRUB, boot, and within seconds you can connect again.

Conclusion:

A distribution upgrade can now easily be done through SSH. I used my work computer’s Konsole, but next time of course I’ll use a smart phone with SSH, to do the upgrade while sitting outside in the sun enjoying some beer!

5 Responses to “Upgrading Ubuntu Server to 11.04 using SSH”

  1. Very nice article mate. Just did an upgrade from 1500 miles across the country using my phone. Thanks!

  2. Hey I was wondering if you know how to do a destructive upgrade that wipes out all configuration and installed files and allows me to choose new ones from the repos to install after and get running.

Trackbacks/Pingbacks

  1. Upgrading Ubuntu Server to 11.10 using SSH @ Freeminded.org
  2. Upgrading Ubuntu Server to 11.04 using SSH »
  3. Samba init script gone? @ Freeminded.org

Leave a Reply