How to Upgrade Ubuntu 22.04 to Ubuntu 24.04 via Command Line

In this guide, we will show you how to upgrade Ubuntu 22.04 to Ubuntu 24.04 LTS via command line. Whether you are a beginner or a seasoned user, this tutorial provides you with clear steps and commands to successfully upgrade your Ubuntu system.

This latest LTS release comes after years of continuous development and dedication from the Ubuntu open-source community. To improve user experience overall, it includes performance enhancements, updated software versions, and new features.

Prerequisite

  • Ubuntu 22.04 system
  • Sudo or root privileges
  • Internet connection

Step 1: Backup Up Your data

Make sure you have a backup of all your important files and directories before proceeding. This ensures that you can still access your data in the event of an unfavorable event, such as a failed upgrade. You can use backup tools, such as Timeshift, for this process.

Step 2: Upgrade the System

Ensure your Ubuntu 22.04 is up to date by running the following commands:

$ sudo apt update
$ sudo apt upgrade -y
$ sudo reboot

You can also confirm your current version of Ubuntu by running the following command:

$ lsb_release -a

Ubuntu-Version-Check-Before-Upgrade

Step 3: Install Ubuntu Release Upgrader Core

The Ubuntu Release Upgrader Core is a comprehensive package that facilitates system upgrades between different Ubuntu releases. It provides you with the necessary tools for upgrading your Ubuntu system from one release to another.

To install this package, run the following command in your command line terminal:

$ sudo apt install ubuntu-release-upgrader-core -y

Once the installation is complete, make sure Prompt is set as lts in the file /etc/update-manager/release-upgrades.

$ sudo vi /etc/update-manager/release-upgrades

Prompt=lts

save and close the file.

Step 4: Upgrade Ubuntu 22.04 to Ubuntu 24.04 via Command Line

As of now, the official upgrade path directly from Ubuntu 22.04 to 24.04 LTS is not available. Therefore, you must start by upgrading to Ubuntu 23.10 and then to 24.04 LTS. You can initiate the upgrade by running the following command:

$ sudo do-release-upgrade

Upgrade-Ubuntu-22-04-to-Ubuntu-23-10

The do-release-upgrade command downloads the required packages, looks for available upgrades, and walks you through the upgrade process. It also makes sure that your data and configurations are preserved during the seamless upgrade between Ubuntu versions.

To finish the upgrade from Ubuntu 22.04 to 23.04, follow the on-screen instructions. After the software upgrade is complete, reboot your system.

Now, let’s upgrade to Ubuntu 24.04. To get started, run the do-release-upgrade command with the -d flag, as shown below:

This command will upgrade your Ubuntu 23.04 to the latest LTS release, in this case, Ubuntu 24.04 code name “Noble Numbat“.

$ sudo do-release-upgrade -d

Upgrade Ubuntu 22.04 to Ubuntu 24.04 LTS via command line

To continue with the upgrade process, type y and press Enter:

A summary of the packages that need to be upgraded, installed, and deleted will be presented to you. In addition, a summary of details regarding the overall size of the download and the duration of the download is also shown.

Type y on your keyboard to proceed.

Choose-Y-to-Download-Remove-Package-During-Ubuntu-24-04-Upgrade

Next, upgrade to the Thunderbird snap package by selecting OK

Choose-Ok-to-Upgrade-thunderbird-duing-ubuntu-upgrade

Here, configure the /etc/fwupd/fwupd.conf file by selecting option N in order to keep your currently installed version.

Type-n-to-keep-default-fwupd-conff-ubuntu-upgrade

In this window, select the default option on the screen and then choose OK

Keep-Grub-Settings-During-Ubuntu-Upgrade

Here, you’ll be presented with the number of packages that are obsolete, type y and press Enter to continue.

Remove-Obsolete-Packages-During-Ubuntu-Upgarde

Your internet connection and the number of installed packages will determine how long the upgrade process takes. You must restart your system following a successful upgrade. Therefore, Choose y and press Enter on your keyboard.

Restart-Your-Ubuntu-Post-Upgrade

Step 5: Verify the Ubuntu Version

Once your system has rebooted, you can confirm the version of Ubuntu using the command:

$ lsb_release -a

Verify-Ubuntu-Version-Post-Upgrade

You can see from the output above that the update to Ubuntu 24.04 LTS was completed successfully. You can go ahead and start exploring this latest release.

Gnome-DE-After-Ubuntu-Upgrade

Conclusion

In this post, we’ve covered the command line upgrade from Ubuntu 22.04 to Ubuntu 24.04 LTS. We hope that the upgrade was completed successfully from your end. Feel free to ask questions in the comment section below.

Leave a Comment

4 × 1 =