Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Steps to Upgrade Ubuntu 20.04 LTS to Ubuntu 22.

04 LTS:

Step 1: Verify the value of Prompt must be lts in /etc/update-manager/release-upgrades


file.
cat /etc/update-manager/release-upgrades

Step 2: Update your system


sudo apt-mark showhold
=> After running above command the output must be empty.
=> If command shows any packages list as output the use below command to unhold those
packages.
sudo apt-mark unhold pkg1 pkg2 (optional)

=> Now run below commands to refresh apt repository and fix dependencies issues in
system.
sudo apt-get update
sudo apt-get install -f

=> Now apply all upgrades using following commands.


sudo apt upgrade
sudo apt-get dist-upgrade

=> Reboot the system using below command.


init 6
or
reboot

Step 3: After system reboot check the firewall status, if it is active then disable it using
below commands.
sudo ufw status
sudo ufw disable (optional)

Step 4: Upgrade to 22.04 LTS using the command line.


sudo do-release-upgrade
=> After running command the prompt message will appear on terminal same as below
screenshot then give "y" as input.
=> After giving y the another message which is shown below will be visible and then press
Enter to continue sshd on port 1022.

=> After above process the another prompt message will appear which give details about
which packages are going to install new, updates and removed.
In this prompt enter "d" to check list of packges to be modified and then "q" to go back to
terminal.
=> Then enter "y" to continue the upgrade process.
=> After above process the new window will open same as below screenshot the give yes
and enter.

=> Now in below screenshot select English


(US) Keyboard and give OK.

=> In above prompt give N


=> After above process new window will open and it will ask to reconfigure
/etc/ssh/sshd_config file.
=> In this windows select the option which show in below screenshot.

=> After above process it will prompt to ask whether obsolate packges to be removed or not.
=> In this screenshot press d to check details and press N to not to remove any packages
because it will also remove clickhouse-client and clickhouse-common which are required for
the NMS.
=> And then another prompt will open which ask to reboot the system. Then press "y" to
reboot it.
=> After system reboot verify the Ubuntu Version in cat /etc/os-release file.

Troubleshoot: In case ssh has been disconnected accidentally then re-login and run below
commands.
screen -ls
=> This command list if any sessions are running in Attached mode.
=> If this shows any sessions are running then run below command to restore it.
screen -x

You might also like