Upgrading Ubuntu 19.04 to Ubuntu 20.04

Ubuntu 20.04 Ubuntu 20.04 It’s time to upgrade home servers, so I have finally gotten aroud to upgrading one system from Ubuntu 19.04 to Ubuntu 20.04

Before Attempting an OS Upgrade

I think it’s important to reiterate: just like with any other in-place major software or OS upgrade, make sure you have backups of your system and a plan to recover from them.

What I mean by having a plan is some basic considerations like:

  • can you boot that system from a different disk or USB stick?
  • do you have the install media prepared (and ideally - tested)?
  • once booted, might there be some issues accessing your old installation like distro mismatch or disk encryption?
  • do you have the root password? have you checked that it works? if system fails to boot, you will need it for single user mode
  • do you have password protected GRUB or BIOS password that you don’t necessarily remember anymore?
  • do you have access to the server console? if it’s a desktop, do you have a monitor and keyboard that will connect (do you have the right cables, will they match the ports you have on the system and do your cables actually reach that system if you urgently need to plug display in)

I hardly mention these lately, but can confirm that each one of these considerations helpd in a relevant scenario - not that long ago. Things like “DVD drive died” or “USB stick worked on 64bit but won’t boot on 32bit system” happen all the time - so it pays to spend 5-10min going through this list before kicking off the upgrade.

How To Upgrade Ubuntu 19.04 to 20.04

If you know Ubuntu Releases at all, you should remember that there’s usually another release between 19.04 and 20.04 - it’s 19.10.

All the x.10 releases are called interim releases - they’re issued about 6 months after each x.04 release and are not supported even for a full year. So you must upgrade very quickly from x.10 release to the next release available.

All the x.04 releases are LTS releases - Long Term Support. This means they’re usually good for a couple of years - fully supported with maintenance updates. For instance, 20.04 will be supported until late 2022 (at which stage the next LTS release 2022.04 will be available).

Before Any Ubuntu Release Upgrade

Be sure to fully update your current OS:

  • apt-get update
  • apt-get upgrade
  • shutdown -r now

Once these are done, you can progress to the OS upgrade

Upgrading to Ubuntu 19.10

I simply ran the do-release-upgrade command as root. See how it picked up the next release:

[email protected]:~ $ sudo -i
[email protected]:~ # do-release-upgrade
Checking for a new Ubuntu release
Your Ubuntu release is not supported anymore.
For upgrade information, please visit:
http://www.ubuntu.com/releaseendoflife

Get:1 Upgrade tool signature [1,554 B]
Get:2 Upgrade tool [1,329 kB]
Fetched 1,331 kB in 0s (0 B/s)
authenticate 'eoan.tar.gz' against 'eoan.tar.gz.gpg'
extracting 'eoan.tar.gz'

Reading cache

Checking package manager

Continue running under SSH?

This session appears to be running under ssh. It is not recommended
to perform a upgrade over ssh currently because in case of failure it
is harder to recover.

If you continue, an additional ssh daemon will be started at port
'1022'.
Do you want to continue?

Continue [yN] y

Starting additional sshd

To make recovery in case of failure easier, an additional sshd will
be started on port '1022'. If anything goes wrong with the running
ssh you can still connect to the additional one.
If you run a firewall, you may need to temporarily open this port. As
this is potentially dangerous it's not done automatically. You can
open the port with e.g.:
'iptables -I INPUT -p tcp --dport 1022 -j ACCEPT'

To continue please press [ENTER]

Reading package lists... Done
Building dependency tree

… after all the calculations I got the summary for the proposed upgrade - you get it before the download of all the packages starts:

10 installed packages are no longer supported by Canonical. You can
still get support from the community.

5 packages are going to be removed. 79 new packages are going to be
installed. 1092 packages are going to be upgraded.

You have to download a total of 955 M. This download will take about
4 minutes with your connection.

Installing the upgrade can take several hours. Once the download has
finished, the process cannot be canceled.

 Continue [yN]  Details [d]y

Fetching

Looked good, so I pressed y and continued.

It took about 30min to download and upgrade packages, and then I rebooted again.

Actually, then I tried to upgrade, but Ubuntu is smart enough to insist on a reboot before doing the next OS upgrade:

[email protected]:~ # do-release-upgrade
Checking for a new Ubuntu release
You have not rebooted after updating a package which requires a reboot. Please reboot before upgrading.

Upgrading to Ubuntu 20.04

Do a basic check of your system:

  • does it still boot fully
  • can you access your files
  • does it start the services you have configured?

And we can continue:

[email protected]:~ # do-release-upgrade
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [1,554 B]
Get:2 Upgrade tool [1,342 kB]
Fetched 1,343 kB in 0s (0 B/s)
authenticate 'focal.tar.gz' against 'focal.tar.gz.gpg'
extracting 'focal.tar.gz'

Reading cache

Checking package manager

Continue running under SSH?

This session appears to be running under ssh. It is not recommended
to perform a upgrade over ssh currently because in case of failure it
is harder to recover.

If you continue, an additional ssh daemon will be started at port
'1022'.
Do you want to continue?

Continue [yN] y

Starting additional sshd

To make recovery in case of failure easier, an additional sshd will
be started on port '1022'. If anything goes wrong with the running
ssh you can still connect to the additional one.
If you run a firewall, you may need to temporarily open this port. As
this is potentially dangerous it's not done automatically. You can
open the port with e.g.:
'iptables -I INPUT -p tcp --dport 1022 -j ACCEPT'

To continue please press [ENTER]

Reading package lists... Done
Building dependency tree

and after a bit - the usual OS uprade summary. More than a thousand of packages will be upgraded, apparently:

Do you want to start the upgrade?


15 installed packages are no longer supported by Canonical. You can
still get support from the community.

5 packages are going to be removed. 111 new packages are going to be
installed. 1308 packages are going to be upgraded.

You have to download a total of 1,072 M. This download will take
about 5 minutes with your connection.

Installing the upgrade can take several hours. Once the download has
finished, the process cannot be canceled.

 Continue [yN]  Details [d]y

Fetching

Why I said You Need To Be Prepared

As luck would have it, this was the time when something went wrong. Perhaps I rebooted the server from another console, but it went down and they wouldn’t boot anymore - I forgot how tricky this 32bit/64bit mix of an mini-server this this is. It just wouldn’t boot anymore.

I had to reconnect my display/keyboard, boot into previous kernel and complete the upgrade:

[email protected]:~ # apt-get upgrade
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
[email protected]:~ # sudo dpkg --configure -a
Setting up mousetweaks (3.32.0-2) ...
Setting up gnome-terminal (3.36.1.1-1ubuntu1) ...
Setting up gir1.2-gtksource-4:amd64 (4.6.0-1) ...
Setting up libgcr-ui-3-1:amd64 (3.36.0-2build1) ...
...

One more final reboot (shutdown -r now) and we’re sporting the Ubuntu 20.04 OS: Ubuntu 20.04 Ubuntu 20.04

Enjoy!

See Also




Keep Learning with Me

Follow me on Facebook and Twitter or jump into Telegram chat!:
I'm using Brave browser
Give it a try, it's awesome: Brave Browser
IT Consultancy
I'm a principal consultant with Tech Stack Solutions. I help with cloud architectrure, AWS deployments and automated management of Unix/Linux infrastructure. Get in touch!

Recent Tweets