Many people will be using LTS (Long Term Support) versions of Ubuntu. These LTS versions are great for developers because it means less updating to major versions. Unlike CentOS where you must reinstall your server to upgrade to a different major version. Ubuntu and Debian both provide a way to upgrade between versions. This is one of the main reasons why many people are moving to Operating Systems with LTS versions like Ubuntu and Debian.
Update Ubuntu 20 LTS to the latest version
First, ensure your Ubuntu 20 LTS server is fully up-to-date. In Ubuntu 20 instances the update-manager-core package should already be installed but if not, install it.
apt-get update && apt-get upgrade -y apt-get install update-manager-core -y
Update from Ubuntu 20 LTS to Ubuntu 22 LTS
To update from Ubuntu 20 LTS to Ubuntu 22 LTS all we now need to do is a do-release-upgrade. This will update the default ubuntu sources.list to the Ubuntu 22 ones. Download Ubuntu 22 LTS and install it on your system. It’s important that you have a way to revert back should something go wrong. Ensure you take a backup or snapshot before issuing this command.
During the Ubuntu update process. You will be asked if you wish to keep the local version of the sshd_config file. Keep the local version if possible. Any customizations you have made like SSH port changes will be lost. So, once complete you will be asked if you would like to reboot the server. Reboot and the upgrade to Ubuntu 22 should be complete.
Finally, verify that the upgrade is completed by checking the version of Ubuntu installed. We can list the contents of the /etc/os-release file to complete this.
In the message back, you should see your Ubuntu version is now Ubuntu 22 LTS.
That’s the process to update Ubuntu 20 to Ubuntu 22. It’s much simpler than when using CentOS.
How was this article?
More from Linux VPS Servers
If you are using Cloudflare on your Apache server you will always see Cloudflare IPs in your logs and not …