Upgrading to Ubuntu 20.04 LTS
TL;DR: sudo do-release-upgrade -d
Ubuntu 20.04 LTS – Focal Fossa – was released on April 23rd 2020 and can be easily upgraded via the Terminal. If you are using Ubuntu on mission critical systems it may be worth holding off to ensure all the bugs are ironed out. But if you like to live on the edge, and run the latest and greatest, please continue.
Just over a year ago I decided to use Ubuntu for my daily driver. I had to make a few tweaks here and there to get things how I wanted them, but overall it hasn’t been a terrible experience.
While I was already on a LTS version of Ubuntu – I thought I might as well upgrade to the latest LTS – and write a blog post about it.
Before you start
Before getting started please ensure you have a backup of your data. Once you have a backup feel free to continue.
Start by ensuring all software updates are installed. To do this open Terminal and run the following command:
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y
This may take some time if you don’t have automatic updates enabled and haven’t manually run an update recently.
Once this has completed, remove old packages and dependencies with the following command:
sudo apt autoremove -y
You can now reboot your computer.
Upgrading Ubuntu
After a reboot has completed we can move onto installing the upgrade. Open up Terminal and type the following command:
sudo do-release-upgrade -d
If you are upgrading a server, it is likely you are connected via ssh. If this is the case a message will display giving instructions on how to enable a secondary access in the event you lose access. If you open the firewall to enable this, remember to close this again after the upgrade.
The upgrade will take some time, during which multiple prompts to continue will be displayed. This will allow you to confirm which packages are going to be removed during the upgrade as well as display information regarding changes to the system. When the upgrade has finished you will be prompted to reboot.
Finalising the Update
After you have rebooted, check again for any updates. This should have been done during the upgrade purpose, but it doesn’t hurt to do it manually. To check for updates open Terminal and run the following command:
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y
Once this has completed, you can also remove any packages and dependencies that are no longer needed. Again this should have been done during the upgrade process, but it doesn’t hurt to do it manually. This can be done with the following command:
sudo apt autoremove -y
To check what versions of Ubuntu is running type the following into Terminal:
lsb_release -a
The following will display if you are running Ubuntu 20.04 LTS:
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04 LTS Release: 20.04 Codename: focal
And there it is, you are now running the latest LTS version of Ubuntu. You can expect to see updates until April 2025.