How to upgrade Ubuntu 20.04 to 22.04 LTS

Overview

Hello fellow Linux learners. I hope you’re all well and ready to gain some new knowledge. Today’s topic will be on how to upgrade Ubuntu 20.04 to 22.04 LTS

I found one test virtual machine that has been left with an old release of Ubuntu 20.04 (Focal Fossa) and I’ll update it to 22.04 (Jammy Jellyfish). Of course, I’m talking about updating and upgrading from terminal. Hopefully there are none among you who thinks „Oh I’ll just go to Software & Updates and update and upgrade“.

Yeah, GUI (Graphic User Interface) is an option, but…

meme

By now, you probably have learned that all we do, we do in terminal. In order to fully harness the power of Linux, you have to make yourself at home in terminal. Once you get the grasp of commands and become comfy in terminal, you’ll see how faster and easier it is to glide through terminal than use GUI.

That said, let’s get to work. First of all, as always when it’s planned to do an upgrade, it’s advisable first to do backup of your files, so make sure you do that. Better safe than sorry. Next thing is checking available space on your hard drive:

df –Th

Update Ubuntu packages

I would recommend at least 20 GiB of free space, but it’ll probably work just fine with only 10 GiB. Like always, the more the better. If you ensured free space, it’s time to begin with updates and upgrades. We’ll start off with basic update and upgrade commands:

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade

or we can shorten it:

sudo apt update -y && sudo apt upgrade -y && sudo apt dist-upgrade –y (-y is added just to avoid being asked for confirmation).

Upgrade Ubuntu

If you look carefully, you’re advised to use command to remove packages that are no longer required, so do it:

sudo apt autoremove

Just to be sure what version of Ubuntu runs on your system, type:

lsb_release –a

Install update-manager-core

Next step in line is ensuring that update manager installed:

sudo apt install update-manager-core

Yup, here it is. So let’s just peek inside to see if it set to LTS (Long Time Support):

sudo vim /etc/update-manager/release-upgrades

Run the Ubuntu upgrade

Ok, this is it, we’re all set and ready to go. Type:

do-release-upgrade –d

hit the Enter key and enjoy the show  Don’t forget to press y and Enter when asked.

Upgrade Ubuntu

Depending on your network bandwidth and computer configuration it will take some time to complete. As I mentioned at the beginning, Firefox is now part of Snap package, so don’t be surprised to see this message.

Upgrade Ubuntu

You’ll be prompted to confirm or deny removing of obsolete packages.

Upgrade Ubuntu

And the last thing you’ll be asked to do is to restart the system.

After the system boots up, start the terminal again and type:

lsb_release –a 	and
uname –mrs

to check for version of Ubuntu and Linux kernel, respectively.

Summary

As you can see, we were able to upgrade Ubuntu 20.04 to 22.04 LTS. Congrats! With successfull upgrade we came to an end of this article. Until next time, stay motivated and productive. C ya!