1. Let’s fetch the latest version of the package list from the repositories.
sudo apt update2. Upgrade the installed packages.
sudo apt upgrade3. Upgrade the distribution and reboot the server.
sudo apt dist-upgradesudo reboot4. Let’s make sure we have the Update Manager Core installed.
sudo apt install update-manager-core
5. Let’s make sure we upgrade to only the latest lts version.
make sure `prompt` is set to lts
prompt=lts
sudo vim /etc/update-manager/release-upgrades
6. Now upgrade the server.
sudo do-release-upgrade -d

