Upgrade Ubuntu LTS versions
Run the update command to refresh the repos:
sudo apt updatePull any upgradeable packages:
apt list --upgradableInstall any outstanding updates:
sudo apt upgrade -yReboot server so its clean:
sudo rebootOnce the server is back up run the above again to catch any additional entries.
Snapshot/backup your device.
Confirm the Update manager is installed/updated:
sudo apt install update-manager-coreMake sure in the update-manager is set to prompt for LTS releases:
tail /etc/update-manager/release-upgradesIf you’ve installed an LTS previously, it should say “Prompt=lts” at the bottom. Leave “Prompt=lts” as is. With this setting, Ubuntu will only upgrade to 22.04 LTS, and the LTS releases that come after (are much more stable).
If you’re using a non-LTS release, it should say “Prompt=normal.” If you upgrade from a non-LTS release, change it to “Prompt=lts” in a text editor (as root).
Upgrading the Server
Its best to complete the following commands from the console to not lose access during the upgrade process:
sudo -sExecute the upgrade command:
do-release-upgrade