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.

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 autoremove

If a new Linux kernel was installed during this process, reboot your machine before moving forward:

sudo reboot

Phase 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-core

Next, check the release upgrade configuration file to verify your upgrade path behavior:

cat /etc/update-manager-core/release-upgrades

Look 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-upgrade

Note 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 tmux or screen. 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.

  1. Confirm the Upgrade: Review the summary and type y to begin the download and installation phase.
  2. 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.
  3. 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 y helps keep your system clean.
  4. 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 -a

The output will display the new version number and description, confirming that your standard Ubuntu upgrade is complete.