Ubuntu releases a new Long Term Support (LTS) version every two years. LTS releases provide five years of guaranteed security updates and maintenance, making them the preferred choice for production servers and stable desktop environments. Upgrading between LTS versions requires careful preparation to ensure system stability and prevent package conflicts.
Preparing Your System for the Upgrade
Before initiating a major distribution upgrade, it is critical to ensure that your current system is fully up to date and free of broken packages. Never attempt a distribution upgrade on a system with pending standard updates.
- Open your terminal window.
- Refresh your local package index by running:
sudo apt update - Install all available updates for your current release:
sudo apt upgrade -y - Perform a full distribution upgrade for your current version to handle any package dependency changes:
sudo apt full-upgrade -y - Remove unnecessary dependency packages that are no longer required:
sudo apt autoremove -y
Installing the Update Manager Core
The tool required to handle version upgrades is usually installed by default, but you should verify its presence before proceeding. The update-manager-core package provides the command-line utility needed for the upgrade process.
sudo apt install update-manager-core
You must also verify that your system is configured to only look for LTS releases. Open the configuration file using the Nano text editor:
sudo nano /etc/update-manager/release-upgrades
Ensure that the last line in the file reads exactly Prompt=lts. If it says Prompt=normal, change it to lts, save the file by pressing Ctrl+O, and exit with Ctrl+X.
Initiating the LTS Upgrade
With your system updated and configured correctly, you can now begin the upgrade process. It is highly recommended to run this command directly from the machine or via a stable SSH connection (e.g., within a screen or tmux session) to prevent disruption if your network drops.
- Start the upgrade process by entering:
sudo do-release-upgrade - The system will check for a new LTS release and calculate the required package changes. It will display a summary showing how many packages will be removed, upgraded, and newly installed, along with the total download size.
- Press
yand hit Enter to confirm and begin downloading the new packages. - During the installation phase, you may be prompted about replacing modified configuration files. Unless you have specifically customized a configuration file and wish to keep your changes, it is generally safer to press
Yor Enter to accept the package maintainer’s new default version.
Finalising the Upgrade
Once all new packages have been installed, the upgrade tool will ask if you want to remove obsolete packages from the previous Ubuntu version. Press y to clean up these old files.
Finally, you will be prompted to restart your system to boot into the new LTS kernel. Press y to reboot immediately.
After the system restarts, you can verify your new Ubuntu version by running:
lsb_release -a
Your system should now display the newly installed LTS release version, fully updated and ready for use.