How to upgrade from Ubuntu 20.04 to Ubuntu 22.04 OS
Posted on September 22nd, 2022
One of the best features of Ubuntu is that we can upgrade the older version of this operating system with the newer one. So, not only do you get the latest ubuntu operating system, but you also get the up-to-date security patches and most recent features.
In this tutorial, we will learn how to upgrade your Ubuntu 20.04 to the latest Ubuntu 22.04 using the command line terminal. Ubuntu 22.04 LTS comes with a lot of new features. Some of them are OpenSSL 3.0 for secure communications, Updated Linux Kernel with latest hardware and security updates, and new versions of lots of packages that were not supported in Ubuntu 20.04 LTS.
Here I have provided all the necessary commands along with the screenshots which I took while upgrading my Ubuntu 20.04 to 22.04 for this tutorial.
Backup The Data of Ubuntu 20.04
Updating the whole operating system is a risky process. It may work 90% of the time without any issues. However, It is always good to back up your server before getting started with the upgrade, just in case!
Before we upgrade our operating system, ensure that you have already backed up all the data from your ubuntu 20.04. You can copy all the data to a hard disk or any storage device.
I have copied all my data to an SSD so that I have my data secured even if the process fails for some reason.
If you use any cloud service, ensure you have created a replica or a snapshot of your volume.
Once you are done securing your data, Execute the list of commands given below to start the upgrade.
Commands For Upgrading Ubuntu 20.04 To 22.04
The complete process of upgrading your Ubuntu to the latest version is divided into 8 steps.
Before proceeding further, I want to show my current Ubuntu version.
If you want to find your current Ubuntu version, use the below command.
Command 1 – $ sudo lsb_release -a
Command 2 – $ sudo apt update && sudo apt upgrade -y
Here we have updated all the local files and system applications of Ubuntu 20.04. Apt is Ubuntu’s default package manager, and sudo means we are running the command with the root privileges.
Command 3 – sudo apt dist-upgrade
Command 4 – $ sudo apt autoremove
If any unwanted packages are present in your ubuntu machine, then the above command will remove those packages.
Command 5 – $ sudo reboot
After running the reboot, wait for a few minutes because the system takes time to shut down and restart again. I had to wait for around 4,5 minutes before my Ubuntu was ready to use again.
Command 6 – $ sudo apt install update-manager-core
Command 7 – $ sudo do-release-upgrade –check-dist-upgrade-only
Command 8 – $ sudo do-release-upgrade -d
Now follow the answers given in the screenshots below. Mostly you will have to answer Y to every question.
Now, check the ubuntu version using this command – $ sudo lsb_release -a
Reply Y to every question which they ask while upgrading.
As you can see in the above screenshot, I successfully upgraded to the Ubuntu 22.04 [Jammy Jelly Fish] operating system from Ubuntu 20.04[Focal Fosaa].
Frequently Asked Questions
As we discussed above, the upgrade is always risky as some of your current applications might lose support when Ubuntu 22.04 boots up. So, is it worth taking the risk?
1. How to Upgrade Ubuntu 16.04 to 20.04 without losing data?
Answer – Losing your data while upgrading an operating system can be disturbing. Even the most reliable software can’t promise complete safety while upgrading any operating system.
It’s better to save all your data manually to another hard disk. Or else, if you use any cloud service, you can create a snapshot of your operating system or duplicate the volume.
2. Is it worth upgrading to Ubuntu 20.04?
Answer – With time, the older operating system shows errors and lags. The OS-providing companies generally stop their services and security updates for the older OS.
So, if you want to experience all the latest features and upgraded security patches and their timely updates, then upgrading your ubuntu operating system is more suitable.
3. How long does the upgrade take?
Answer – For me, the upgrade took around 20 minutes. This upgrade was quick because I was using a high-speed internet connection. For you, the upgrade time may vary depending on your internet speed.
4. How much internet data is required for upgrading Ubuntu from 20.04 to 22.04?
Answer – Upgrading Ubuntu 20.04 to 22.04 will take roughly 500 MB to 1 GB of internet. So make sure you have this much internet data available.
In this tutorial, we learned to upgrade your older ubuntu version 20.04 to newer ubuntu 22.04 in 8 easy steps. All the commands for upgrading your operating system are mentioned above.
We also learned how you could have your data safe while upgrading and also answered the most asked questions about upgrading Ubuntu to the latest OS.
We hope that you were also able to upgrade your Ubuntu OS to the latest one. If not, then please mention the error or any doubt in the comment section below.