Ubuntu

How do I upgrade from Ubuntu 20.04 to 22.04 terminal?

How do I upgrade from Ubuntu 20.04 to 22.04 terminal

Ubuntu 22.04 is the latest LTS (Long-term support) version of Ubuntu. It provides us with new and enhanced features such as “Ruby 3.0”, “Python 3.10.4”, “OpenSSL 3.0”, “PHP 8.1.2” and a bunch of other latest packages. Apart from new packages, Ubuntu 22.04 also focuses on improved software stability and improved security patches.

In this article, we will perform steps in order to upgrade from the Ubuntu 20.04 version to the Ubuntu 22.04 Version using the Terminal.

How Do I Upgrade From Ubuntu 20.04 to 22.04 using Terminal?

Having an upgraded Ubuntu version, we get the latest software and new security patches without having to uninstall the previous version and reconfigure our whole Operating System. Apart from these, with an upgraded system we benefit from “Bug Fixes”, “Software Compatibility”, “Hardware Support”, “Performance” and several other features.

Follow the steps below to upgrade from Ubuntu 20.04 to 22.04 using Terminal.

Step 1: Checking Current Version

Use the “lsb_release” command to check the current version:

lsb_release -a

This will display the OS Details in the terminal and you can see the current version of our Ubuntu OS is 20.04:

Step 2: Upgrading and Updating Existing Packages

Upgrade the existing packages by the Command below:

sudo apt update && sudo apt upgrade

This will take some time to update and upgrade the packages. Wait for it to complete.

Once updated and upgraded, reboot the system using the command

sudo reboot

This will reboot the system

Step 3: TCP Port Configuration

Before updating, to ensure minimizing security risk, you have to enable the SSH Port (1022) as a fallback port in case the connection on port 22 drops. To configure TCP Port 1022 walk through the steps below. Allow the TCP Port 1022, by using the command

sudo ufw allow 1022/tcp

This will update the firewall rules.

Now to apply the rules, reload the firewall using the command:

sudo ufw reload

Now verify the port using the command:

sudo ufw status

Step 4: Upgrade using “do-release-upgrade” Tool

To upgrade the Ubuntu version, you have to use the “do-release-upgrade” tool which can be used for both GUI and CLI. We will use the CLI method. First, Install the manager core using the below command:

sudo apt install update-manager-core

Now commence the upgrade using the below-provided “sudo” command:

sudo do-release-upgrade

This will check for a new Ubuntu version to upgrade to:

It will now ask for the installation continuation confirmation. Press “Y” to continue:

The installation when completed will pop up a new window asking for the Firefox Configuration Package. Click on “OK” to continue installing Firefox Snap.

As fresh Firefox Snap is to be installed, it will ask for confirmation to remove the obsolete packages. Press “y” to continue:

Restart the system by pressing “y”:

Step 5: Verification

Once the system reboots, verify the installed updated version of Ubuntu using the command:

lsb_release -a

Here you will see the version of your Ubuntu system has been upgraded from 20.04 to 22.04:

This is how you can upgrade from Ubuntu 20.04 to 22.04 using the Terminal.

Conclusion

Upgrading from one Ubuntu version to another is quite easy unlike in other Operating Systems. With the latest Ubuntu versions, we get the latest software and new security patches without having to uninstall the previous version and reconfigure our whole Operating System. This article explained the steps needed to upgrade from Ubuntu 20.04 to newer Ubuntu 22.04 Version using the Terminal.

Similar Posts