Upgrade Ubuntu over ssh. Using terminal and screen

Written by
Date: 2013-04-25 13:43:13 00:00


When a new version of Ubuntu is released, and you need to upgrade a server or a desktop, you can not access directly, the only option you have is to use the terminal and a ssh connection.

As soon as you are logged in, run:

sudo do-release-upgrade

This will take care of everything. It will open a terminal session, and it will start a second instance of ssh, in case the first one is upgraded and failed to be restarted as part of the upgrading process.

The screen session, will allow you to close the terminal window and recover the session later by issuing:

sudo screen -x

Run the above command when you reconnect to the server, if for some reason, the ssh stopped working run:

ssh user@server.tld -p 1022

And then the prior mentioned command