How to Upgrade Ubuntu 20.10 from Ubuntu 21.04
First, check the current version of your machine.
root@vps:~# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.10
DISTRIB_CODENAME=groovy
DISTRIB_DESCRIPTION="Ubuntu 20.10"
root@vps:~#
Then, Check that your system is up to date by running the following commands.
apt-get dist-upgrade -y
Output:
root@vps:~# apt-get dist-upgrade -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
eatmydata libeatmydata1 python3-importlib-metadata python3-jinja2
python3-json-pointer python3-jsonpatch python3-jsonschema python3-markupsafe
python3-more-itertools python3-pyrsistent python3-zipp
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Once all updates are installed, Then install the update-manager-core package if it is not already installed.
apt-get install update-manager-core
Output:
root@vps:~# apt-get install update-manager-core
Reading package lists... Done
Building dependency tree
Reading state information... Done
update-manager-core is already the newest version (1:20.10.1).
update-manager-core set to manually installed.
The following packages were automatically installed and are no longer required:
eatmydata libeatmydata1 python3-importlib-metadata python3-jinja2
python3-json-pointer python3-jsonpatch python3-jsonschema python3-markupsafe
python3-more-itertools python3-pyrsistent python3-zipp
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@vps:~#
Go to the last line of /etc/update-manager/release-upgrades configuration file is set to ‘lts' if you only want LTS upgrades or to 'normal' if you want non-LTS upgrades.
vi /etc/update-manager/release-upgrades
Output:
# Default behavior for the release upgrader.
[DEFAULT]
# Default prompting and upgrade behavior, valid options:
#
# never - Never check for, or allow upgrading to, a new release.
# normal - Check to see if a new release is available. If more than one new
# release is found, the release upgrader will attempt to upgrade to
# the supported release that immediately succeeds the
# currently-running release.
# lts - Check to see if a new LTS release is available. The upgrader
# will attempt to upgrade to the first LTS release available after
# the currently-running one. Note that if this option is used and
# the currently-running release is not itself an LTS release the
# upgrader will assume prompt was meant to be normal.
Prompt=lts
Now launch the upgrade tool by running the following command.
do-release-upgrade -d
NOTE: While running the command it'll prompt for several permissions.
Press y to confirm the upgrade.
Select Yes and continue.
Select the OpenSSH configuration as you required.
After a restart, login and check the current Ubuntu version on your server by running the following command.
cat /etc/lsb-release
Output:
root@vps:~# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=21.04
DISTRIB_CODENAME=hirsute
DISTRIB_DESCRIPTION="Ubuntu 21.04"