How to Upgrade to Ubuntu 20.04

Ubuntu 20.04 with the CodeName (Focal Fossa) was officially released on April 23, 2020 and the LTS version will be supported for 5 years. If you have a Ubuntu 19.10 or Ubuntu 18.04 system you can upgrade quite easily, if you don’t use 18.04 LTS you probably should upgrade to 20.04. In this guide we will go through the different steps you need to take to simply upgrade your system to the lastest Ubuntu version.
Prerequistes
If you want to upgrade your system directly you need to use either Ubuntu 18.04 or Ubuntu 19.10. If you still run an older version of Ubuntu, you need to upgrade this version to Ubuntu 18.04 or 19.10 first. To be able to upgrade you need to be superuser. Either be logged in as the root user or setup your user with sudo privileges.
If you are not sure which Ubuntu you are using. You can either open the search with the Windows Button and then type About
. Or you can open your terminal an run cat /etc/*elease
to find out your Ubuntu version.
Before you start with your upgrade, you should also backup your data. This is for safety reasons if an error occurs. If you are running Ubuntu on a virtual machine, doing a backup is relatively easy. You can do a complete system snapshot. If anything goes wrong you can use these snapshot to restore to the previous state.
Updating all Packages before the Upgrade
Before you start the release upgrade, you have to make sure that all currently installed packages are up to date. Outdated packages might not be working anymore on Ubuntu 20.04.
Packages that have been marked as ‘held back’ cannot be automatically installed, updated or removed. To check if you have any held back packages on your system, you can run the following command:
sudo apt-mark showhold
If the command shows any ‘on-hold’ packages, you can unhold these by typing:
sudo apt-mark unhold PACKAGE
Once you are sure that there are no undhold packages, we can update the currently installed packages. Type:
sudo apt update
sudo apt upgrade
Depending on your system and your latest updates, this will take a while. Once it is finished reboot the system
sudo reboot
Now you can perform a full-upgrade with the following command:
sudo apt full-upgrade
Note: full-upgrade will also remove unnecessary or unused packages.
Upgrade to Ubuntu 20.04 LTS
The upgrade process is pretty straighforward. To do so you have 2 options. Either from the command line or using the GUI update tool on your Ubuntu system.
In this guide I will show you how to upgrade to Ubuntu 20.04 using the command line, this will work for both Server and Desktop.
We will be using the ‘do-release-upgrade’ package. This package should be installed by default, if for any reason the package is not available, you can install it with:
sudo apt install update-manager-core
After you dae sure update-manager-core is installed you can start the upgrade with:
sudo do-release-upgrade -d
This command disables all third-party repositories and change the apt list to the new Ubuntu 20.04 repositories. During the process you will be prompted several times that you want to contiune with the upgrade process. To continue the upgrade process you have to type ‘y’ for yes into the command prompt.
The whole upgrade process runs inside a Screen session and automatically reattach if connection drops.
The upgrade process may take up to 30m+, depending on the number of packages that have to be updated and your Internet speed. Once all packages are up to date, the upgrade installer ask you to remove obsolete software, that is not longer been used. You can type ’d’ to check which obsolete packages will be removed. To remove the packages you can enter ‘y’.
If everything went well, the upgrade will output a completion text and will ask you to reboot the system. After confirming the system will automatically reboot. You now have successfully upgraded your machine to Ubuntu 20.04.
Confirm Upgrade
After the system reboots you can confirm the newly installed version with the following command:
cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04 LTS (Focal Fossa)
ID=ubuntu
ID_LIKE=debian
Excellent you can now enjoy your fresh Ubuntu 20.04.
Conclusion
Upgrading from Ubuntu 18.04 or 19.10 to Ubuntu 20.04 is a relatively easy task.
If however you encountered any error, you can visit the Ubuntu wiki. This site covers all known issues and might help. If you still have problems you can either visit Ubuntus forum or ask in the command section down below.