Steps to Upgrade Ubuntu Version
Upgrading your Ubuntu OS ensures access to the latest features and security updates. This guide outlines the steps to upgrade from version 22 to 24, including pre-upgrade preparations, the upgrade process, and post-upgrade tasks to ensure a smooth and successful transition.
Prerequisites
Internet connectivity
1022 port must be open. You can use the below command:
sudo /sbin/iptables -I INPUT -p tcp --dport 1022 -j ACCEPT
OR
ufw allow 1022
Stop the main-server and analytics-server services.
Take the backup of the following components and copy them to another location:
- ServiceOps Database
- ServiceOps folder
- ServiceOps FileDB folder
Verify the Ubuntu OS version before the upgrade
Applicable Version
This document applies to Ubuntu v22 only.
Process
To upgrade the Ubuntu v22 OS, follow the below steps:
Check the current version of Ubuntu OS using the below command:
cat /etc/os-release
To upgrade, run the below command:
sudo apt update
Next, run the below command:
sudo apt upgrade-y
Enter "y" to continue the process.
Next, run the below command:
sudo apt dist-upgrade –y
Next, remove the unnecessary packages that are installed automatically by using the below command.
sudo apt autoremove --purge -y
Next, clean the local repository using the below command:
sudo apt clean
Install the update-manager-core package if not present using the below command:
sudo apt install update-manager-core
Verify that the “do-release-upgrade” tool is available in the system. If missing, install it using the below command:
sudo apt install ubuntu-release-upgrader-core
Before running the above command, check whether the “/etc/update-manager/release-upgrades” file contains the “Prompt=lts” parameter using the below command:
cat /etc/update-manager/release-upgrades
If not, update it.
9. Now, initiate the upgrade process using the below command:
sudo do-release-upgrade –d
Next, enter "y" to continue the installation process.
Next, enter "y" to continue.
Press the "Enter" key.
Enter "y" to continue.
The Configuring keyboard configuration screen appears. Select the keyboard language as "English".
Select the Keyboard Layout as “English (US)”.
Configure openSSH server. Select the "Keep the local version currently installed" option.
Once done, press “enter” and proceed. Enter "N" for no to remove the extra packages during the upgrade process.
Enter "y" to restart the system.
Once the Linux machine is up and running, check its current version using the below command:
cat /etc/os-release
Once the Ubuntu 24 is successfully updated, remove the extra packages from the server using the below command:
sudo apt autoremove
After upgrading the Ubuntu version, allow approximately 15-20 minutes for system processes to synchronize and stabilize fully.