How To Upgrade from Ubuntu 20.04 To Ubuntu 22.04

Posted on 27 views

In our previous guide, we went through how to install Ubuntu 22.04, today, we will systematically walk through how to upgrade from Ubuntu 20.04 to Ubuntu 22.04. Ubuntu 22.04 with the codename Jammy Jellyfish is still in the development stages with the final candidate expected in April 2022. However, users of Ubuntu 20.04 are able to upgrade to this latest release right now.

Jammy Jellyfish offers flavors for both ARM64 (AArch64) and 64-bit architectures. Furthermore, it offers daily builds for Ubuntu Mate, Lubuntu, Xubuntu, Ubuntu Kylin, and Ubuntu Budgie flavors. This release, Ubuntu 22.04 is based on the previous release Ubuntu 21.04(Impish Indri)

Ubuntu 22.04 is a Long term support release with continued support for 5 years. It comes with a lot of exciting features and a lot of differences from the previous LTS release Focal Fossa. The features associated with Ubuntu 22.04 include:

  • Support for PHP 8.1 to give coders easy access to the latest PHP intergration.
  • OpenSSL 3.0 – this version was released in September 2021 and will be included in Ubuntu 22.04 to improve security.
  • It will be the first of its kind to ship the latest GNOME 40 desktop environment series most probably GNOME 41 or 42.
  • Support for Ruby 3.0 and Golang 1.18
  • New desktop Installer written in Google’s Flutter SDK and Linux kernel 5.17 series
  • GCC 11.x as the default system compiler

Jammy Jellyfish is still in the development stages far away from the final and bug-free release version, thus not advisable to install it as a primary OS. However, enthusiasts, developers, and early adopters can upgrade their Ubuntu 20.04 systems to this version with the aid of this guide and follow its development.

Pre-requisites

For this guide, you will require the following:

  • A user with root or sudo privileges.
  • Ubuntu 20.04 system

Check the Linux Kernel and the Ubuntu version on your system.

$ uname -r 
5.4.0-90-generic

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"

Now let’s plunge in!

Upgrade from Ubuntu 20.04 To Ubuntu 22.04

Below are steps on how to upgrade from Ubuntu 20.04 To Ubuntu 22.04:

Step 1 – Update your system.

First, ensure that your system is updated to the latest stable packages. This will help ensure that there is minimal difference between the packages in the new Ubuntu 22.04 and your Ubuntu 20.04.

sudo apt update && sudo apt upgrade
sudo apt dist-upgrade

Remove the no-longer required packages from your system.

sudo apt autoremove

Reboot your system

sudo reboot

Step 2 – Backup your Ubuntu 20.04 (Focal Fossa) System.

Before you can commence on the upgrade task, you need to make a backup of your data and system configurations. For those running cloud-based virtual machines, it is easy to take snapshots and restore them later in case of anything.

It is highly recommended that you take a backup of the contents of /etc/var/lib/apt/extended_states/var/lib/dpkg and the output of dpkg –get-selections “*”. There are quite a number of tools that can be used to make a backup of these system files and configurations. Some of them are:

  • Deja Dup– a GUI utility used to backup personal data.
  • Restic– a commandline utility tool used to save multiple revisions of files in an encrypted repository stored on different backends.
  • Deja Dup – This is a GUI utility used to backup personal data.
  • Rsync– a commandline utility tool used to backup personal and $ Home directory data.
  • Timeshift– a tool used to backup system files and configurations.
  • Rsnapshot– this is a commandline utility tools that creates periodic snapshots for local and remote machines over ssh.

There are many other tools such as BackupPC, Lsyncd, Bareos, Barman, Duplicati, Bacula, Borg e.t.c. Check out for more details on how to use the above tools on the dedicated guide below.

Step 3 – Perform an Upgrade from Ubuntu 20.04 To Ubuntu 22.04.

We will use the package update-manager-core to upgrade our system to this latest release version.

sudo apt install update-manager-core

With the package downloaded successfully, we will run the Ubuntu upgrade utility.

To check for available updates without applying them run:

$ sudo do-release-upgrade --check-dist-upgrade-only
Checking for a new Ubuntu release
There is no development version of an LTS available.
To upgrade to the latest non-LTS development release
set Prompt=normal in /etc/update-manager/release-upgrades.

The -d flag here instructs the system to proceed with the upgrade even though the new version has not been released officially. This option means upgrade to the development release.

sudo do-release-upgrade -d

If you want to upgrade with third party mirrors and repositories enabled instead of commenting them out, add the --allow-third-party option.

sudo do-release-upgrade -d --allow-third-party

The setup will commence by checking the package manager. If you are running your system under SSH, you will be required to continue as below.

How-To-Upgrade-from-Ubuntu-20.04-To-Ubuntu-22.04

Additional sshd will be started as below. Press Enter to proceed.

How-To-Upgrade-from-Ubuntu-20.04-To-Ubuntu-22.04-1

Now allow the upgrade to Ubuntu 22.04 to continue.

How-To-Upgrade-from-Ubuntu-20.04-To-Ubuntu-22.04-2

Configure libc6 service to restart when required.

How-To-Upgrade-from-Ubuntu-20.04-To-Ubuntu-22.04-3-1024x207

The upgrade process will proceed as below with several configurations being made to your system.

How-To-Upgrade-from-Ubuntu-20.04-To-Ubuntu-22.04-4

Proceed and configure Postfix for mailing. There are several options to configure your Postfix mail server. If you wish to do this configuration later, you can select “no configuration” and proceed.

How-To-Upgrade-from-Ubuntu-20.04-To-Ubuntu-22.04-5

A new Linux kernel 5.13 for Ubuntu 22.04 will be installed and also several packages updated as below.

How-To-Upgrade-from-Ubuntu-20.04-To-Ubuntu-22.04-6

Once complete, you will see this. A restart is required for the changes made to your system to take effect fully. Press “Y” to restart your Ubuntu system.

How-To-Upgrade-from-Ubuntu-20.04-To-Ubuntu-22.04-7

That is it! You have successfully, upgraded your Ubuntu 20.04 to Ubuntu 22.04.

Step 4 – Verify your Ubuntu 22.04 Upgrade.

When your system reboot, verify this by checking the Linux kernel and Ubuntu version as below.

How-To-Upgrade-from-Ubuntu-20.04-To-Ubuntu-22.04-8

That proves that the upgrade process has been a success.

Remove packages no longer required on your system.

sudo apt --purge autoremove
sudo apt autoclean

Step 5 – Restore Your Backup.

After you have verified that everything is working perfectly, you can restore the backup you made earlier.

You can then install your desired packages on your new Ubuntu 22.04 system. Update your APT package index as below.

$ sudo apt update
Get:1 http://de.archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:2 http://de.archive.ubuntu.com/ubuntu jammy-updates InRelease [90.7 kB]
Get:3 http://de.archive.ubuntu.com/ubuntu jammy-backports InRelease [90.7 kB]
Get:4 http://de.archive.ubuntu.com/ubuntu jammy-security InRelease [90.7 kB]
Get:5 http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [13.2 MB]
Get:6 http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 c-n-f Metadata [280 kB]
Fetched 14.0 MB in 2s (6,671 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.

That is it! I hope this guide on how to upgrade from Ubuntu 20.04 To Ubuntu 22.04 was able to help you. In case of any troubles in the upgrade process, feel free to share with us in the comments.

coffee

Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.