How Do You Upgrade an Older Ubuntu Release?
Upgrading an older Ubuntu release to a newer one involves preparing your current system, updating existing software packages, and utilizing Ubuntu’s native upgrade management tools to transition safely. The standard procedure ensures data preservation while replacing core operating system components with their updated equivalents. This guide covers the essential steps required to execute a system upgrade seamlessly from the command line, which applies to both Ubuntu Desktop and Server environments.
Phase 1: Pre-Upgrade Preparations
Before initiating a major operating system upgrade, taking precautionary steps minimizes the risk of package conflicts or system failure.
- Back Up Crucial Data: While the upgrade process
generally keeps user files intact, unexpected errors or power loss can
compromise the system. Back up your files, configuration directories
(such as
/etc), and database states to an external drive or cloud storage. - Verify Free Disk Space: Upgrading requires
downloading hundreds of new packages. Ensure you have at least 10 GB of
free space on your root partition by checking disk usage:
df -h / - Disable Third-Party Repositories: External Personal Package Archives (PPAs) and custom repositories can interfere with the dependency resolution of the new release. It is safest to disable them in your Software sources list before proceeding.
Phase 2: Updating the Current System
An upgrade must always start from a fully updated version of your current release. This prevents version mismatches during the transition.
Open a terminal and run the following commands sequentially to refresh your package list, update existing software, and remove obsolete packages:
sudo apt update
sudo apt upgrade -y
sudo apt dist-upgrade -y
sudo apt autoremoveIf a new Linux kernel was installed during this process, reboot your machine before moving forward:
sudo rebootPhase 3: Configuring the Upgrade Tool
Ubuntu uses the update-manager-core package to manage
release transitions. Verify that the tool is installed on your
system:
sudo apt install update-manager-coreNext, check the release upgrade configuration file to verify your upgrade path behavior:
cat /etc/update-manager-core/release-upgradesLook for the Prompt= line. If you are running a Long
Term Support (LTS) version and wish to upgrade to the next sequential
LTS version (e.g., Ubuntu 22.04 LTS to Ubuntu 24.04 LTS), ensure it is
set to:
Prompt=lts
If you are using a standard short-term release and want to move to the next immediate release, it should be set to:
Prompt=normal
Phase 4: Executing the Release Upgrade
With the system prepared, launch the interactive upgrade wizard by executing:
sudo do-release-upgradeNote for SSH Users: If you are performing this upgrade remotely over SSH, it is highly recommended to run this command inside a terminal multiplexer like
tmuxorscreen. This prevents the upgrade from failing midway if your network connection drops.
Phase 5: Following the Interactive Prompts
The upgrade tool will calculate the changes, alter your system repository paths to point to the new release, and present a summary of the packages to be downloaded, upgraded, and removed.
- Confirm the Upgrade: Review the summary and type
yto begin the download and installation phase. - Handle Configuration Prompts: During installation, the system may prompt you regarding modified configuration files. You can choose to keep your custom configurations or replace them with the package maintainer’s defaults.
- Remove Obsolete Packages: Once the new packages are
installed, the tool will ask whether you want to delete obsolete
packages left over from the old OS version. Selecting
yhelps keep your system clean. - Reboot: When the process finishes, you will be prompted to restart your system to finalize the upgrade.
Phase 6: Verifying the Upgrade
After your system reboots, log in and verify that the operating system has successfully updated to the target version by running:
lsb_release -aThe output will display the new version number and description, confirming that your standard Ubuntu upgrade is complete.