​How to Upgrade to Ubuntu 20.04

Published on

4 min read

Upgrade to Ubuntu 20.04

Ubuntu 20.04 LTS (Focal Fossa) was released on April 23, 2020, and it will be supported for five years. It comes with a lot of new packages and major software upgrades, including the latest versions of OpenJDK, GCC, Python, Ruby, and PHP. This release is based on the Linux 5.4 LTS kernel and adds support for new hardware and filesystems. The desktop edition comes with GNOME 3.36 and a new default theme called Yaru.

This tutorial explains how to upgrade to Ubuntu 20.04 LTS from Ubuntu 18.04 or Ubuntu 19.10.

Prerequisites

You can upgrade directly to version 20.04 from either Ubuntu 18.04 or Ubuntu 19.10 directly. If you run any previous release, you must first upgrade to Ubuntu 18.04 or 19.10.

The upgrade operation must be run with superuser privileges. You need to be logged in as a root or a user with sudo privileges .

Backup Your Data

First and foremost, make sure you backup your data before starting the major upgrade of your operating system. If you are running Ubuntu on a virtual machine, it is best to take a complete system snapshot so you can quickly restore your machine in case the update goes wrong.

Update Currently Installed Packages

Before starting the release upgrade, it is recommended to update all your currently installed packages to their latest versions.

Packages marked as held back cannot be automatically installed, upgraded, or removed. This may cause issues during the upgrade process. To check whether there are held back packages on your systems run:

sudo apt-mark showhold

If there are on hold, packages, you should unhold the packages with:

sudo apt-mark unhold package_name

Refresh the apt list and upgrade all installed packages:

sudo apt updatesudo apt upgrade

If the kernel is upgraded, reboot the machine, and once booted log back in:

sudo systemctl reboot

Perform a major version upgrade of the installed packages:

sudo apt full-upgrade

apt full-upgrade may also remove some unnecessary packages.

Remove all automatically installed dependencies that are no longer needed by any package:

sudo apt --purge autoremove

Upgrade to Ubuntu 20.04 LTS (Focal Fossa)

Upgrading to the latest Ubuntu version is a pretty straightforward process. You can upgrade either from the command line with do-release-upgrade or using the GUI update tool.

We’ll perform the update from the command-line, which should work for both Desktop and Server systems.

do-release-upgrade is part of the “update-manager-core” package that is installed by default on most Ubuntu systems. If for some reason it is not installed on your system, install it with:

sudo apt install update-manager-core

Start the upgrade process by entering:

sudo do-release-upgrade -d

The command will disable all third-party repositories and change the apt list to point to focal repositories. You will be prompted several times to confirm that you want to continue with the upgrade. When asked whether you want the services to be automatically restarted during the upgrade type y.

During the upgrade process, the command will ask you various questions, like whether you want to keep an existing configuration file or to install the package maintainer’s version. If you didn’t make any custom changes to the file, it should be safe to type Y. Otherwise, is recommended to keep the current configuration. Read the questions carefully before making a selection.

The upgrade runs inside a GNU screen session and will automatically re-attach if connection drops.

The whole process may take some time depending on the number of updates and your Internet speed.

Once the new packages are installed, the update tool will ask you if you want to remove the obsolete software. If you are not sure type d and check the list of obsolete packages. Generally it is safe to enter y and remove all obsolete packages.

When the upgrade process is complete and assuming all went well, you’ll be asked to reboot your machine. Type y to continue:

System upgrade is complete.

Restart required

To finish the upgrade, a restart is required.
If you select 'y' the system will be restarted.

Continue [yN] y

Confirm the Upgrade

Wait for a few moments until your system boots up and log in.

If you are a desktop user, you will be greeted with a new graphical boot splash and login screen.

You can also check the Ubuntu version by entering the following command:

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04 LTS
Release:	20.04
Codename:	focal

That’s it. Enjoy your new Ubuntu 20.04 installation.

Conclusion

Upgrading to Ubuntu 20.04 LTS is a relatively easy and painless task.

If you hit any error, visit the release notes page, which covers the known issues that might happen during the upgrade process.

Feel free to leave a comment if you have any questions.