In my last blog article, I reported on the launch of Ubuntu 24.04, new features, and how to protect it with BDRSuite. You can read more details here Protect your Linux workloads with BDRSuite.
Today I am going to show you how to upgrade from Ubuntu 22.04 to Ubuntu 24.04.
So, let’s get started.
Verify Ubuntu version
Before we continue with the actual steps, we should first check which version of Ubuntu we are using in our infrastructure. Open Terminal and type cat /etc/os-release to see the version.
As you can see, I am using Ubuntu 22.04.4 LTS, codenamed Jammy.
What version are you running?
Step 1: Backup your Ubuntu 22.04
Before you perform a new update or upgrade, you should make a backup of the current state of your Ubuntu machine. Is there a better way than using BDRSuite? BDRSuite will help you back up your Ubuntu 22.04 or any other operating system, whether bare-metal or hypervisor.
Whether you’re installing Ubuntu 22.04 on a workstation or hosting it on Hyper-V, VMware, KVM, or Proxmox – BDRSuite has got you covered.
BDRSuite can be installed on Windows, Windows Server, Linux, and docker containers. Here is the blog article that explains how to install BDRSuite on Windows and Windows Server.
Any questions, please let us know in the comment section.
Step 2: Configure firewall rules
By default, Linux uses SSH port 22 to perform the upgrade process. We should open an additional port, TCP 1022, which will act as a fallback port in case SSH dies during the upgrade process.
- Open Terminal
- Enter the following command to allow the TCP 1022 port
sudo ufw allow 1022/tcp - Enter the following command to enable the firewall:
sudo ufw enable - Enter the following command to accept the traffic to port 1022:
sudo /sbin/iptables -I INPUT -p tcp –dport 1022 -j ACCEPT
Step 3: Update and Upgrade Ubuntu 24.04
In this step, you will update and upgrade all installed packages on Ubuntu 22.04. In this way, we ensure that Ubuntu 22.04 is ready for the upgrade to Ubuntu 24.04. To do so, you will need to use the root account.
During the update and upgrade process, you may be prompted to enter Y to confirm the upgrade process. Please do so.
- Open Terminal
- Enter the following commands one after the other and press Enter. You will be prompted to enter a root password.
sudo apt-get update
sudo apt list –upgradable | more
sudo apt upgrade
Step 4: Upgrade Ubuntu 22.04 to Ubuntu 23.10
In this step, we will first upgrade from Ubuntu 22.04 to Ubuntu 23.10, and then in the fourth step to Ubuntu 24.04. Before proceeding with the upgrade to Ubuntu 23.10 which is a non-LTS version, we need to modify the release-upgrade file.
Why? Linux prioritizes LTS upgrades over non-LTS upgrades.
- Open Terminal
- Enter the following command and press Enter.
sudo nano /etc/update-manager/release-upgrades - Navigate to Prompt=LTS and change it to Prompt=normal. You can move to Prompt using the down arrow keys on the keyboard
- Press CTRL + O, and then press Enter to save the file
- Press CTRL + X to exit the nano editor
- Enter sudo reboot to reboot Ubuntu 22.04
- Once rebooted, open Terminal again and enter the following command to start the upgrade process:
sudo do-release-upgrade - Once finished, you will be asked to restart your Linux
- Once restarted, open Terminal, and enter the following command to verify the version installed. As you can see, I am running Ubuntu 23.10, codename Mantic.
sudo lbs_release -a
You will be prompted to enter Y to confirm and proceed with the upgrade process. During the procedure, Linux will remove, refresh, and install packages.
Step 5: Upgrade Ubuntu 23.10 to Ubuntu 24.04 LTS
In this step, we will upgrade from Ubuntu 23.10 to Ubuntu 24.04 LTS. Since 24.04 is an LTS
version, we must revert Prompt to LTS.
- Open Terminal
- Enter the following command and press Enter.
sudo nano /etc/update-manager/release-upgrades - Navigate to Prompt=normal and change it to Prompt=lts. You can move to Prompt using the down arrow keys on the keyboard
- Press CTRL + O and press Enter to save the file
- Press CTRL + X to exit the nano editor
- Enter the following command, enter Y and press Enter to start the upgrade process:
sudo do-release-upgrade - You will be prompted to enter Y to confirm and proceed with the upgrade process
- Press Enter to confirm an upgrade to Thunderbird Snap. Starting in Ubuntu 24.04, all new releases of Thunderbird are only available to Ubuntu users through the snap package
- You will be prompted to enter Y to confirm and proceed with the upgrade process
- Once the upgrade is done, you will notice a new UI which means Ubuntu 24.04 is successfully installed
Once confirmed, the upgrade process will continue
Additionally, you can verify the version in Terminal by using the following command:
sudo lbs_release -a
Conclusion
Upgrading from Ubuntu 22.04 to Ubuntu 24.04 is a straightforward process when following the outlined steps. First, confirm your current Ubuntu version to ensure you’re starting from 22.04.
Then, back up your Ubuntu 22.04 using BDRSuite to protect your data. Next, configure your firewall rules by allowing a fallback SSH port (TCP 1022) to avoid disruptions during the upgrade.
After securing your system, update and upgrade all installed packages on Ubuntu 22.04. This step ensures your system is prepared for the upgrade. Subsequently, upgrade to Ubuntu 23.10 by modifying the release-upgrades file to prioritize non-LTS updates temporarily. Reboot and follow the prompts to complete this intermediate upgrade.
Finally, revert the release-upgrades file to prioritize LTS updates and proceed with the upgrade to Ubuntu 24.04 LTS. Confirm necessary changes during the process, such as migrating to Thunderbird Snap.
Once completed, you’ll enjoy the new features and improved interface of Ubuntu 24.04.
Do you have any questions? Please let us know in the comments.
Related Posts:
Ubuntu 24.04 is Here! Protect your Linux workloads with BDRSuite
Follow our Twitter and Facebook feeds for new releases, updates, insightful posts and more.