How to Upgrade Ubuntu 20.04 to 22.04 LTS

In this guide, we will cover how to upgrade Ubuntu 20.04 to 22.04 LTS (Jammy Jellyfish) step-by-step.

Ubuntu 22.04 (Jammy Jellyfish) has officially been released. It’s the latest Ubuntu LTS release and it ships with numerous improvements and new applications such as PHP 8.1, Ruby 3.0, OpenSSL 3.0, Golang 1.18, GNOME 42, and improved support for Raspberry Pi to mention just a few. We already have a guide on how to install Ubuntu 22.04.

In case, you have Ubuntu 20.04 LTS and don’t feel like starting from scratch, you can easily upgrade to Ubuntu 22.04 using a few simple steps.

Upgrade Ubuntu 20.04 to 22.04 LTS

Without any further delay, let deep dive into the actual upgrade process. Before initiating the upgrade, kindly take the backup of all your files using timeshift tool.

Prerequisites

Before you commence the upgrade, ensure that you have the following in place:

  • An instance of Ubuntu 20.04 with a sudo user configured
  • A high-speed internet connection. In this guide, we are using an internet connection of 15 Mbps.
  • At least 10 GB of free disk space is recommended. If you have a separate boot partition, ensure that you have at least 200MB of free space on that partition.

1) Upgrade Ubuntu to the Latest Release

To begin the upgrade process, log in to your Ubuntu 20.04 instance and upgrade all the packages to their latest versions.

$ sudo apt update && sudo apt upgrade -y

Apt-update-and-upgrade-command-ubuntu

This might take a while depending on how many packages have pending upgrades. While the upgrade is in progress. Just sit back and relax and let it continue.

Upon completion, reboot your system.

$ sudo reboot

Login once again and verify that you are running the latest release of Ubuntu 20.04, which should be Ubuntu 20.04.4.

You can verify this using the command:

$ lsb_release -a

lsb-release-command-before-upgrade

2) Begin Upgrade From Ubuntu 20.04 to 22.04

To initiate the actual upgrade, run the following command.

$ sudo do-release-upgrade -d

The command checks for the availability of a new Ubuntu release and proceeds to download the upgrade tool.

Upgrade Ubuntu 20.04 to 22.04 LTS

The upgrade tool performs a series of operations. It updates the local package index, checks for installed snaps, and determines their size. It then proceeds to update the repository information.

To continue, simply hit ENTER on your keyboard.

Press-Enter-configure-package-manager-ubuntu-upgrade

Moving on, the upgrade tool will provide you with a summary of the following:

  • Packages that are no longer supported by Canonical.
  • The number of obsolete packages that will be removed.
  • The number of new packages that are going to be installed.
  • The number of packages that are going to be upgraded
  • The total download size of all the packages and the estimated time taken to download them.

To continue, type ‘y’ and hit ENTER.

Press-y-download-package-for-ubuntu-upgrade

All the current ‘focal’ sources list files for Ubuntu 20.04 will be overwritten by ‘jammy’ sources list files for Ubuntu 22.04.

Updating-Package-Repositories-Jammy-Ubuntu

There are services installed on your system that will be affected during the upgrade and will certainly need to be restarted.  Thankfully, the upgrade tool will automatically restart these services for you since manually restarting them will interrupt the upgrade process.

Restarting-Services-during-upgrade-ubuntu

From here, the upgrade to Ubuntu 22.04 will continue. This takes quite some time as the system downloads new packages and installs them.

Downloading-Installing-Packages-for-Ubuntu-Upgrade

Starting from Ubuntu 22.04, Firefox will only be available to Ubuntu users via the snap package. The Firefox upgrade will automatically transition Firefox to snap. If you have an instance of Firefox running, close it and select the ‘OK’ option to transition Firefox to a snap package.

Configure-Firefox-as-snap-during-ubuntu-upgrade

Along the way, you will be prompted to remove or purge old packages which are a by-product of the upgrade process. Press ‘y’ and hit ENTER to continue.

Remove-Package-During-Upgrade-Ubuntu

Finally, you will be prompted to reboot your system to complete the upgrade. Simply press ‘y’ and press ENTER to reboot.

Reboot-after-upgrade-ubuntu

The restart will take a bit longer than usual, so just be patient. Finally, the login screen will appear. Click on your username and provide a password to log in.

Login-Screen-After-Ubuntu-Upgrade

This ushers you to the Ubuntu 22.04 (Jammy Jellyfish) desktop as shown below.

Ubuntu-22-04-Desktop-Screen-After-Upgrade

You can head over to the terminal and verify that the upgrade was successful, once again, checking the version of Ubuntu.

$ lsb_release -a

lsb-release-command-after-upgrade

The output confirms that we have successfully upgraded from Ubuntu 20.04 to Ubuntu 22.04.

Conclusion

And there yo go. We have successfully upgraded Ubuntu 20.04 system to the latest LTS release, Ubuntu 22.04. Enjoy the new features, performance improvements, and security updates that come with the latest iteration of this beloved Linux distribution. As always, stay tuned for future updates and releases from the Ubuntu community, as they continue to shape the landscape of open-source computing.

10 thoughts on “How to Upgrade Ubuntu 20.04 to 22.04 LTS”

  1. after running command
    lsb_release -a
    I got message on terminal
    Please install all available updates for your release before upgrading.
    Could you please help me in this.
    Thank you.

    1. Hello Hrushikesh, this means that you did not fully upgrade your system or there was something that prevented it. Kindly run

      $ sudo apt update && sudo apt upgrade -y

      Then proceed from step 2 onwards. There shouldn’t be any issue after that.

  2. I followed this instruction smooth upgrade from 20 to 22

    though you must also add that after the apt get and apt upgrade you need to run

    apt install dist-upgrade

    or your it will not continue and will ask you to install updates

  3. This doesn’t work for me. Here is what I enter and what I get as a result.
    larry@larry-MS-7693:~$ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 20.04.6 LTS
    Release: 20.04
    Codename: focal
    larry@larry-MS-7693:~$ sudo do-release-upgrade -d
    [sudo] password for larry:
    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.
    *****Nothing happens so I enter the command without the hyphen d.
    larry@larry-MS-7693:~$ sudo do-release-upgrade
    Checking for a new Ubuntu release
    Please install all available updates for your release before upgrading.
    *****Yes! I previously installed all available updates. Why doesn’t it upgrade to OS to 22.04 LTS?

Leave a Comment

Your email address will not be published. Required fields are marked *