LinuxCommandLibrary

do-release-upgrade

Upgrade to the newest Linux distribution release

TLDR

Upgrade to the latest release

$ sudo do-release-upgrade
copy

Upgrade to the latest development release
$ sudo do-release-upgrade [[-d|--devel-release]]
copy

Upgrade to the latest proposed release
$ sudo do-release-upgrade [[-p|--proposed]]
copy

SYNOPSIS

do-release-upgrade [OPTIONS]

PARAMETERS

-h, --help
    Displays a brief help message and exits.

-d, --devel-release
    Checks for a development release upgrade. Useful for upgrading from an LTS to an interim release, or to the very latest development branch.

-f DISTRO
    Specifies a target distribution release to upgrade to (e.g., 'focal', 'jammy'). This option is rarely used by most users.

-m, --mainline
    Allows upgrading to non-LTS releases even when currently on an LTS version, if a newer mainline release is available.

-p, --proposed
    Uses packages from the 'proposed' repository during the upgrade. This can lead to less stable upgrades and is generally not recommended for production systems.

-c, --check-dist-upgrade-only
    Performs only the upgrade check without prompting for installation or downloading packages.

-r, --reboot-required
    Checks if a reboot is necessary after the upgrade has completed.

-s, --status
    Shows the current status of the release upgrade process, if one is in progress.

-D, --debug
    Enables verbose debug output, useful for troubleshooting.

-q, --quiet
    Suppresses most output during the upgrade process, useful for scripting (though interactive prompts still occur unless -y is used).

-y, --assume-yes
    Automatically answers 'yes' to all prompts during the upgrade process. Use with extreme caution as this can lead to unintended configuration changes or data loss.

DESCRIPTION


do-release-upgrade
is the command-line utility used to perform a full distribution upgrade of Ubuntu to a newer release. It's part of the update-manager-core package and serves as the backend for the graphical Update Manager.

The command first checks for a new stable release of Ubuntu. If one is found, it prepares the system for the upgrade by checking network connectivity, available disk space, and disabled third-party repositories. It then downloads all necessary packages for the new release, prompts the user about configuration file changes (allowing to keep current, install new, or compare), and handles the installation process.

It's designed to provide a guided, interactive upgrade experience, helping to migrate user settings and installed applications while minimizing potential conflicts. For LTS (Long Term Support) releases, it typically offers to upgrade only to the next LTS release by default, but options exist to upgrade to interim or development releases.

CAVEATS


1. Backup Your Data:
Always back up all critical data before initiating a distribution upgrade.
2. Stable Internet Connection: A stable and reliable internet connection is crucial as gigabytes of data may be downloaded.
3. Third-Party PPAs/Repositories: Custom PPAs or third-party repositories often need to be disabled or removed before the upgrade to prevent conflicts. Re-enable them after the upgrade is complete and verify their compatibility.
4. Disk Space: Ensure sufficient free disk space (at least 10-15 GB is often recommended) for the new packages and temporary files.
5. Time Commitment: A full release upgrade can take several hours depending on internet speed and system performance.
6. Power Source: For laptops, ensure it's plugged into a power source to avoid power loss during the upgrade.
7. Server Upgrades: On server systems, it is highly recommended to perform upgrades in a maintenance window with a tested backup and recovery plan.

PRE-UPGRADE CHECKLIST

Before running do-release-upgrade, it's highly recommended to:
1. Update current packages: Run
sudo apt update && sudo apt upgrade && sudo apt dist-upgrade
to ensure all currently installed packages are up-to-date.
2. Remove obsolete packages: Use
sudo apt autoremove
to clear out unneeded dependencies.
3. Disable third-party PPAs/repositories: Manually disable all third-party software sources and PPAs from your system's software sources before starting the upgrade.
4. Check system health: Ensure no critical services are running that cannot tolerate an interruption.

LTS VS. INTERIM RELEASE UPGRADES

By default, do-release-upgrade from an LTS (Long Term Support) release will only offer to upgrade to the *next* LTS release. For example, from Ubuntu 20.04 LTS, it will offer to upgrade to 22.04 LTS. If you wish to upgrade to an interim (non-LTS) release, you must use the -d (or --devel-release) option, e.g.,
sudo do-release-upgrade -d
. This would allow an upgrade from 20.04 LTS to 21.04 (if supported by the upgrade path), and then successively to subsequent interim releases until the next LTS.

INTERACTIVE PROMPTS FOR CONFIGURATION FILES

During the upgrade, if new versions of configuration files conflict with your modified versions, do-release-upgrade will prompt you. You'll typically have options to:
- Install the package maintainer's version: Overwrites your changes.
- Keep your currently installed version: Retains your changes, but might cause issues if the new package expects a different configuration.
- Show the differences (diff): Allows you to compare the two versions.
- Merge the files: Allows for interactive merging (though this can be complex for many users).

HISTORY

The do-release-upgrade command is an integral part of Ubuntu's update management system, maintained by Canonical. It was developed to streamline the often complex process of upgrading an entire operating system to a new major version. Prior to its widespread adoption, users often had to manually edit sources.list and handle dependency conflicts, which was prone to errors. do-release-upgrade, along with its graphical counterpart update-manager, provides a more robust, guided, and interactive experience, automating many of the intricate steps involved in a distribution upgrade and significantly improving the reliability of the process since its introduction in earlier Ubuntu releases.

SEE ALSO

apt(8), apt-get(8), update-manager(8), lsb_release(1), dpkg(8)

Copied to clipboard