Sysadmin

Ubuntu Server Upgrade: do-release-upgrade and Best Practices

Ubuntu Server Upgrade: do-release-upgrade and Best Practices

Upgrading an Ubuntu server from one Long Term Support (LTS) release to the next is an operation that intertwines technical, security, and infrastructure governance aspects. It requires careful planning and the use of the official do-release-upgrade tool to ensure stability and reduce risks. This process differs from regular package updates, and if performed without due precautions, it can lead to service interruptions or data corruption.

Upgrade Ubuntu Server in 60 seconds

# 1. Check the current version
lsb_release -a

# 2. Update all packages for the current release
sudo apt update && sudo apt full-upgrade -y

# 3. Reboot the system if required (check /run/reboot-required)
sudo reboot

# 4. Install the upgrade utility (if not present)
sudo apt install update-manager-core

# 5. Start the release upgrade (without -d in production!)
sudo do-release-upgrade

# 6. After reboot, check the status of failed services
systemctl --failed

# 7. Check logs for errors
journalctl -p err -b

Ubuntu Server is distributed in Long Term Support (LTS) versions with extended support, designed for production environments where stability and predictability are priorities. The official documentation clearly distinguishes between updating individual packages within the same release and a full release upgrade, emphasizing that moving from one LTS to the next is a different operation from routine daily updates. The canonical commands apt update, apt upgrade, and apt dist-upgrade keep the system current within the same Ubuntu version, downloading and installing security updates, bug fixes, and new versions of existing packages, while jumping between releases (e.g., from Ubuntu 22.04 LTS Jammy to Ubuntu 24.04 LTS Noble) requires using the release upgrading infrastructure.

Reference versions: Ubuntu Server 22.04 LTS, Ubuntu Server 24.04 LTS · documentation consulted November 2026

Prerequisites

Before initiating a do-release-upgrade, it’s essential to ensure the system is in an optimal state. This includes: a stable and high-performance network connection, sufficient disk space (several gigabytes for new packages), and the absence of broken packages or inconsistent configurations. It’s also crucial to have root privileges and a robust terminal session, preferably via tmux or screen if the upgrade is via SSH, to mitigate the risks of disconnection. Canonical’s documentation recommends performing a full system update of the current system before the release jump, and rebooting if necessary to ensure the latest kernel is in use.

When to upgrade (and when to wait for .1)

The question “when to upgrade” has an answer that depends on both Canonical’s official policies and the risk posture of the organization managing the Ubuntu Server. From the vendor’s side, the rule is clear: one can only upgrade directly from the current LTS to the next chronological LTS, and LTS→LTS upgrades are officially offered only after the first point release of the new LTS. For the current generation, Ubuntu 24.04 LTS release notes indicate that 23.10 users saw the upgrade option shortly after release, while 22.04 LTS users receive the offer only after the 24.04.1 LTS version is published. This behavior is consistent with the practice reported in the upgrade documentation, which states that “Upgrades from one LTS release to the next one are only available after the first point release” and that, if one wishes to upgrade before .1, the -d option must be used to force the upgrade to the release considered “development” by the upgrade system. The -d option is explicitly indicated as not recommended for production environments, precisely because it allows bypassing the vendor’s planned maturation mechanism and accessing a release that may still contain unresolved regressions.

From a sysadmin’s perspective, the combination of these elements leads to distinguishing at least three scenarios. The first is for standard production environments, for which the cautious guideline is to wait until Canonical automatically enables the LTS→LTS upgrade, i.e., wait at least until .1 of the new LTS, to benefit from the correction of the most critical bugs and the community’s initial experiences with the migration. The second scenario is for test environments, staging, or controlled subsets of infrastructure (e.g., part of a cluster’s nodes or some non-critical systems), for which using the -d option before .1 may be justified to evaluate the impact of the new release on specific applications and configurations, provided that the vendor advises against this behavior on production systems. The third scenario is for contexts that require features introduced in the new LTS, such as improvements in Samba, new network modules, or kernel updates, and for which the decision to anticipate the upgrade must be weighed against the release notes and reported regressions.

Ubuntu 24.04 LTS release notes form an essential basis for this evaluation because, in addition to listing new features, they explicitly document potentially impactful changes and known issues. For example, in the sections related to Ubuntu Server, it is noted that the freeradius package may be accidentally removed by the release upgrade tool during the transition from 22.04 LTS to 24.04 LTS, and that this removal appears in the upgrade summary before actions are executed. This is a classic example of a problem that can be corrected in the .1 point release or later, and which makes the choice to wait for the release to mature particularly sensible if freeradius is a critical component for the infrastructure. Similarly, the notes indicate that some GlusterFS modules for qemu and Samba are no longer integrated into the base packages and must be reinstalled manually (qemu-block-supplemental, samba-vfs-modules-extra) after the upgrade, signaling the need for careful planning for environments that use them. These elements confirm that the “safest” time for an LTS→LTS upgrade is when the vendor has already had the opportunity to identify and document the main compatibility impacts, typically starting from .1.

Backup and snapshots before starting

Canonical’s official guides dedicate ample space to a pre-upgrade checklist, which represents the minimum security baseline before invoking do-release-upgrade on an Ubuntu server. The first key element is the need to bring the current system to the latest update level, by performing a full package upgrade with apt. The server documentation suggests running sudo apt update to update the package index, followed by sudo apt dist-upgrade -o APT::Get::Always-Include-Phased-Updates=true, to download and install all the latest versions of installed packages, including any phased updates. The system should then be checked to verify that no further updates are available, and it is recommended, and sometimes required, to perform a reboot if a file like /run/reboot-required indicates the need for a reboot. The server guide in PDF format reiterates that the upgrade works best when the system is fully updated and recommends a reboot after updates to ensure the latest kernel is in use, before proceeding with the release upgrade.

The second element of the checklist is disk space. Server and upgrade guides warn that a release upgrade involves downloading hundreds of new packages, often several gigabytes, especially on systems with a lot of additional software, and recommend ensuring there is enough free space to manage the temporary expansion of the filesystem during the procedure. For Desktop systems, the same recommendation is echoed in a more generic form, with the indication that the upgrade needs “several gigabytes” of space for new packages, and that available capacity should be checked before proceeding. An accurate assessment of space is particularly important on systems with separate partitions for /var or /boot, where package and kernel download and installation activities are concentrated.

The third element, perhaps the most critical, is data backup. Official documentation insists that, although upgrades are normally safe, there is always the possibility that something goes wrong, and that it is “extremely important” that data be copied to a backup location, to allow restoration in case of problems during the upgrade. Server guides emphasize that backup should include not only application data but also significant configurations and, if possible, a snapshot of the system state, while the desktop guide recommends users to back up their personal data to an external storage device. In enterprise contexts, this often translates into database backups, volume snapshots, export of network service configurations, and formalized recovery plans.

In addition to traditional backups, Ubuntu documentation includes guidance on storage-level snapshot tools, particularly ZFS and LVM, which can provide a valuable safety net before a release upgrade. The ZFS manpage describes snapshots as read-only copies of a filesystem or volume, created extremely quickly and initially without additional space consumption, because they share blocks with the active dataset until subsequent modifications. As data in the active dataset changes, the snapshot consumes space, but at creation, it represents a consistent photograph of the filesystem, and the manpage emphasizes that snapshots are created atomically, including all changes from completed system calls up to that point. Filesystem snapshots are accessible via the .zfs/snapshot directory at the root of the filesystem, and are automatically mounted on demand, offering a simple way to access data in the previous state. An example provided by the ZFS manpage shows the creation of a snapshot named yesterday on the pool/home/bob filesystem using the command zfs snapshot pool/home/bob@yesterday. This snapshot is exposed in the .zfs/snapshot directory and allows access to the filesystem’s content as it was at the time of creation, enabling backups, verifications, or selective restorations. Read also: Backup 3-2-1-1-0: Rule Explained with Real Example

For LVM, Ubuntu server documentation describes a similar logical volume snapshot feature. LVM allows “freezing” an existing volume at a given moment, even while the system is running, creating a snapshot volume that appears as an image of the original volume, while the main volume continues to be used normally. The guide emphasizes that this feature can be used to obtain a consistent image of the filesystem to be backed up without having to shut down the system, and that the snapshot can be used to save the system state and then return to it later if necessary. Furthermore, LVM allows mounting the snapshot volume and modifying it without affecting the original volume, a useful behavior for verifications or tests. Read also: mysqldump Backup: Consistency & MySQL/MariaDB Restore

Bringing the current system to the latest level

To understand the path to a release upgrade, it is essential to distinguish between package updates and a full operating system release change. Ubuntu’s software management tools are based on apt, which allows updating installed packages from the current release’s repository using the commands sudo apt update and sudo apt upgrade or sudo apt dist-upgrade. The apt update command updates the local package index database, while apt upgrade installs new versions of existing packages without removing or installing new dependencies, and apt dist-upgrade goes further, updating packages more aggressively, installing new dependencies, and, if necessary, removing packages to resolve conflicts. The server guide explicitly distinguishes between these commands and a release upgrade, stating that they “only upgrade the packages for the release of Ubuntu that we are using” and that, to move to the entire next release (e.g., from 22.04 LTS to 24.04 LTS), do-release-upgrade must be used.

The first operational step towards do-release-upgrade is therefore to bring the system to its most updated state within the current release. The server documentation provides a precise sequence of commands, recommending to run sudo apt update to update package indices, followed by sudo apt dist-upgrade -o APT::Get::Always-Include-Phased-Updates=true to install all new package versions available, including phased updates. The APT::Get::Always-Include-Phased-Updates=true option is used to ensure that even gradually distributed updates are included, reducing the risk of ending up with partial package combinations. After executing these commands, the guide recommends verifying that no further updates are available, possibly re-running apt update and apt upgrade for confirmation.

After performing package updates, it is crucial to check if the system requires a reboot, particularly for kernel updates. Server guides indicate that the presence of the /run/reboot-required file signals that a reboot is necessary, and recommend performing the reboot before starting do-release-upgrade. To check this, you can use:

# Check if the system requires a reboot
if [ -f /run/reboot-required ]; then
    echo "Reboot required. Run 'sudo reboot' before continuing."
fi

The PDF server guide adds that it is advisable to reboot the system after applying all updates, to verify that the latest kernel is actually running, reducing the possibility of encountering problems during the release upgrade. This step is important because many kernel and driver changes are only completed after a reboot, and a system running an old kernel while having updated packages can be in an inconsistent state.

Launching the upgrade from a secure session

The core of the release upgrade operation on Ubuntu Server is the do-release-upgrade command, described in the manpages and server documentation. The basic syntax is do-release-upgrade [options], and the tool is designed to be run from the command line, preferably with root privileges via sudo, on systems without a graphical interface or managed remotely. The manpages indicate that this command is “the preferred command if the machine has no graphic environment or if the machine is to be upgraded over a remote connection”, confirming its centrality in the server context. To ensure the command is available, the documentation suggests installing the update-manager-core package via sudo apt install update-manager-core, after which sudo do-release-upgrade can be invoked.

Official documentation indicates that do-release-upgrade is designed to be run even from remote SSH sessions, but warns that a disconnection during the process can leave the system in an inconsistent state. To mitigate this risk, the use of terminal multiplexers like tmux or screen is strongly recommended. These tools allow the upgrade session to remain active even if the SSH connection drops, allowing reconnection and resuming from where it left off. An example of starting a tmux session and the upgrade command is as follows:

# Start a new tmux session
tmux new -s ubuntu_upgrade

# Run the upgrade within the tmux session
sudo do-release-upgrade

# If the SSH connection drops, you can reconnect and resume with:
tmux attach -t ubuntu_upgrade

In usual scenarios, the typical combination on servers is simply sudo do-release-upgrade, possibly with -m server, letting the tool decide the appropriate mode, and without using -d or --allow-third-party on production systems. The use of more advanced options is generally limited to test or automation contexts, where one is willing to manually manage the consequences of non-standard behaviors.

Third-party repositories and PPAs

One of the main obstacles to a successful release upgrade is third-party repositories (PPAs – Personal Package Archives) and unofficial package sources. Canonical’s documentation emphasizes that unofficial repositories are the most common cause of system upgrade failures and recommends, where possible, to avoid release upgrades and prefer redeployment on new releases, particularly when unofficial repositories and PPAs are present. This is because packages from these sources may not have been updated for the new Ubuntu release, creating unresolvable dependencies or conflicts with system packages. Before starting do-release-upgrade, it is good practice to temporarily disable or remove all third-party repositories.

To identify third-party repositories, you can check the /etc/apt/sources.list.d/ directory:

# List third-party repository files
ls /etc/apt/sources.list.d/

Each file in this directory represents an additional package source. To disable them, you can comment out lines starting with deb or deb-src within these files, or temporarily move the files to a backup directory. do-release-upgrade will attempt to automatically comment out third-party repositories, but a preventive manual disabling is safer. After the upgrade, repositories can be re-enabled one by one, verifying the availability of packages compatible with the new LTS.

Questions about configuration files

During the do-release-upgrade process, the system may present questions related to configuration files (conffile) that have been locally modified by the administrator. This happens when the new version of a package includes an updated version of a configuration file that differs from the one currently on the system. The upgrade tool will offer several options:

  • Install the package maintainer’s version: Overwrites the local configuration file with the new version provided by the package. This is often the safest option for standard configuration files that have not been significantly customized, but it will lose local modifications.
  • Keep the currently installed version: Keeps the local configuration file, ignoring the version provided by the package. This option is useful if critical customizations have been made, but it may lead to unexpected behavior if the new package version expects the updated configuration.
  • Show differences (diff): Allows comparing the two versions of the file, highlighting the changes. This is the recommended approach for important and customized configuration files, allowing the administrator to understand the differences and make an informed decision.
  • Merge configurations: In some cases, the system may offer to automatically merge changes, but this option is less common and should be used with caution.

It is crucial not to answer these questions automatically. For each locally modified configuration file, it is good practice to examine the differences and, if possible, manually merge significant changes into the new version of the configuration file. If in doubt, keep the local version and then manually integrate necessary changes after the upgrade, consulting the specific package’s documentation. Improper conffile management is a common source of post-upgrade problems, such as services not starting or unexpected behavior.

Post-reboot checks

The do-release-upgrade process concludes with a system reboot. After the reboot, it is essential to perform a series of checks to verify that the upgrade was successful and that all services are operational. These checks include:

  1. Verify Ubuntu version: Ensure the system is running the new LTS. This can be done with:
    lsb_release -a

A typical output should show the new version, for example Release: 24.04 and Codename: Noble.

  1. Service status: Check that all critical services are started and running, and that there are no services in a failed state. The systemctl command is indispensable:
    # Show all services in 'failed' state
systemctl --failed

If there are services in a failed state, examine the logs to understand the cause.

  1. System logs: Analyze logs to detect any significant errors or warnings that occurred during or after system startup. journalctl is the primary tool:
    # Display errors from the current boot
journalctl -p err -b
  1. Network connectivity: Verify that the network interface is correctly configured and that the server can reach necessary network resources (DNS, gateway, other servers, internet).
  1. Specific applications and services: Perform functional tests on applications hosted by the server (web servers, databases, authentication services, etc.) to ensure they operate as expected. This is particularly important for applications with specific dependency requirements.
  1. Disk space: Check disk space after the upgrade, as there may be temporary files or old kernels that can be removed. Read also: Linux: Free Up Disk Space with 12 Commands (SysAdmin Guide 2026)

These checks are crucial for identifying and promptly resolving any issues, preventing them from turning into prolonged outages.

Rolling back if something goes wrong

Despite the best planning, a release upgrade can always fail. The ability to revert to a previous, working state is fundamental. Rollback strategies depend on the backups and snapshots taken before the upgrade:

  • Restore from snapshot (ZFS/LVM): If ZFS or LVM snapshots of the entire system or critical volumes were created, rollback can be relatively quick. For ZFS, a command like zfs rollback pool/rpool@pre-upgrade can revert the filesystem to the snapshot’s state. For LVM, it is possible to restore the logical volume from the snapshot. This is often the fastest solution for a complete operating system rollback.
  • Restore from traditional backups: If filesystem-level, database, and configuration backups were performed, restoration will require reinstalling the previous Ubuntu version and then restoring all data and configurations. This process is longer and more complex, but offers a recovery option even in case of complete operating system corruption or hardware problems.
  • Redeployment on new image (cloud): In the case of cloud images, as specified by Canonical, the recommended path in case of failure or even as a primary strategy is the redeployment of a new instance with the desired LTS, and migration of workloads and data. This avoids the specific problems of in-place upgrades in cloud environments, where some customizations are applied only at image creation. Read also: Proxmox VE 9 Sizing: Hardware Requirements for Nodes

Regardless of the strategy, it is essential that the rollback plan is well-documented and tested, to reduce recovery times in an emergency.

Common Errors and Troubleshooting

Exact Error or Message Cause Solution
No new release found. Upgrade to the new LTS has not yet been enabled (e.g., .1 hasn’t been released) or Prompt is set to never in /etc/update-manager/release-upgrades. Wait for the first point release of the new LTS, or modify /etc/update-manager/release-upgrades by setting Prompt=lts or Prompt=normal. In non-production environments, you can use sudo do-release-upgrade -d.
Could not calculate the upgrade / Cannot upgrade from '...' to '...' Active third-party repositories or broken/inconsistent packages. Temporarily disable all third-party repositories and PPAs. Run sudo apt update && sudo apt full-upgrade -y and sudo apt autoremove to clean the system.
Services do not start after reboot Overwritten configuration files or broken dependencies. Check systemctl --failed and journalctl -p err -b. Restore configuration files from backup or examine diff during the upgrade. Verify package dependencies.
Insufficient disk space /boot, /var, or / full due to new packages or old kernels. Free up space before the upgrade. Remove old kernels with sudo apt autoremove --purge and clear the apt cache with sudo apt clean.

Frequently Asked Questions

Should I reboot the server before running do-release-upgrade?

Yes, it is highly recommended to reboot the system after applying all package updates for the current release. This ensures that the system is using the latest kernel and that all services are in a consistent state before beginning the release upgrade process, reducing the risk of problems due to outdated components.

Can I skip an LTS version (e.g., from 20.04 to 24.04)?

No, Canonical only supports sequential upgrades between LTS versions (e.g., from 20.04 to 22.04, then from 22.04 to 24.04). Attempting to skip an LTS version is not supported and can lead to an unstable or non-functional system, as do-release-upgrade is not designed to handle such a large jump in dependencies and configurations.

Is it safe to use do-release-upgrade -d in production?

No, the -d option forces the upgrade to the development release or the new LTS before its first point release (.1) has been issued. This option is intended for testing or developers and is not recommended for production environments, as the release may still contain critical bugs or regressions that will be resolved in subsequent versions.

What happens to my customized configuration files?

During the upgrade, do-release-upgrade will detect configuration files (conffile) that you have modified locally. It will ask if you want to keep your version, install the package maintainer’s version, or view the differences. It is crucial to examine these differences to avoid losing important customizations or introducing incompatible configurations.

How can I re-enable third-party repositories after the upgrade?

After the upgrade is complete and the system is stable, you can re-enable third-party repositories one by one. Edit the files in /etc/apt/sources.list.d/ to uncomment the lines or restore the original files. Remember to run sudo apt update after each re-enablement and verify package compatibility with the new Ubuntu release.

Conclusions with Operational Takeaways

Upgrading Ubuntu Server to a new LTS version with do-release-upgrade is a delicate operation but manageable with the right planning. The main takeaway is that preparation is as important as the upgrade execution itself. Waiting for the first point release of the new LTS, performing full backups and snapshots, cleaning up third-party repositories, and carefully managing configuration files are non-negotiable steps. After the reboot, a systematic check of services and logs will ensure system stability. By implementing these best practices, a release upgrade can become a predictable and reliable process, safeguarding the operational continuity of services.

Sources

Updated: November 2026

Share this article:

Written by

Rosario Giordano

Rosario Giordano is a system administrator and IT consultant specializing in cybersecurity and cloud, with over 20 years of experience managing enterprise Linux infrastructures. His areas of expertise include SSH hardening, Kubernetes platforms, PostgreSQL databases, VMware/ Proxmox virtualization, and compliance with NIS2 and ISO 27001 security frameworks