This article will show, how you can upgrade ubuntu version on the instance via CLI (Command Line Interface)
First make sure to create an instance and to log into the instance. Then follow the instructions below step by step and execute the commands in the terminal:
1) Display detailed information about the Linux distribution you are currently running on the instance. It provides information such as the distributor ID, release number, codename, and more.
lsb_release -a |
After executing "lsb_release -a" in the terminal you should see information displayed
2) Update your package information
sudo apt update |
3) Install latest versions of preinstalled packages
sudo apt upgrade -y |
4) Install new packages, remove existing packages, and perform other system-level changes to resolve dependency conflicts
sudo apt dist-upgrade |
5) Install the ‘update-manager-core’ package if it is not already installed
sudo apt install update-manager-core |
6) Install the ‘ubuntu-release-upgrader-core’ package if it is not already installed
sudo apt install ubuntu-release-upgrader-core |
7) Open & edit 'release-upgrades' file
sudo vim /etc/update-manager/release-upgrades |
Press 'i' to go into insert mode
Locate the line that displays "Prompt=never" and change it to "Prompt=lts"
Press ‘esc’ to exit insert mode and type ':wq' to save & exit
8) Reboot the instance
sudo reboot |
9) Again, log into the instance
10) Upgrade the Ubuntu operating system to a newer release version
sudo do-release-upgrade |
11) You will be prompted ‘Do you want to continue?'. Type ‘y’ & press 'Enter’
Terminal output
12) Then again press 'Enter'
Terminal output
13) Then, you will be prompted ‘Do you want to start the upgrade?'. Type 'y' & press 'Enter’
Terminal output
14) Then, it will ask ‘Restart services during package upgrades without asking?'. Select 'Yes' & press 'Enter’
Update screen
15) Select ‘Country of origin for the keyboard’. Select 'Ok' & press 'Enter’
Update screen
16) Select the 'Keyboard layout' of your choice. Select 'Ok' & press 'Enter’
Update screen
17) Then, you will be prompted 'What do you want to do about modified configuration file sshd_config?'
Select 'install the package maintainer's version'. Then, select 'Ok' & press 'Enter'
Update screen
18) It will ask 'Remove obsolete packages?'. Type 'y' & press 'Enter’
Terminal output
19) You will see a message 'System upgrade is complete. Restart required'. Type 'y' & press 'Enter’
Terminal output
20) Check detailed information of the ‘Upgraded Ubuntu’ OS on the instance
lsb_release -a |
Terminal output after executing "lsb_release -a"