Linux
View all Worklets
LinuxLinux

Linux - Configuration - Ubuntu Distribution Upgrade

Upgrades Ubuntu LTS endpoints to the next major LTS version sequentially

Worklet Details

What the Ubuntu distribution upgrade Worklet does

This Automox Worklet™ upgrades Ubuntu LTS endpoints to their next major LTS release. For example, the Worklet can upgrade from Ubuntu 20.04 LTS to 22.04 LTS, or from 22.04 LTS to 24.04 LTS.

Ubuntu requires sequential upgrades, meaning an endpoint running 20.04 LTS cannot jump directly to 24.04 LTS. The Worklet handles this automatically by checking available versions and performing incremental upgrades. You can run the Worklet repeatedly until each endpoint reaches your target LTS version.

The Worklet performs critical pre-flight checks before attempting any upgrade. It validates that the system is configured for LTS upgrades, that all pending package updates are applied, and that no system reboot is pending. If these conditions are not met, the Worklet exits gracefully to prevent upgrade failures.

Why upgrade Ubuntu to the latest LTS version

Operating system version management is critical for security, stability, and compliance. Ubuntu LTS releases receive five years of standard support plus five additional years of extended security maintenance. Running outdated LTS versions increases exposure to unpatched vulnerabilities and limits access to bug fixes that improve system reliability.

Major LTS upgrades include significant kernel updates, security improvements, and hardware support enhancements. Many organizations standardize on the latest LTS to simplify system administration, reduce support complexity, and maintain consistent security postures across their Linux infrastructure.

The Worklet automates what would otherwise require manual intervention on each endpoint, allowing you to standardize your Ubuntu fleet without time-intensive manual upgrades.

How Ubuntu distribution upgrades work

  1. Evaluation phase: The Worklet checks the endpoint's current Ubuntu version by reading /etc/os-release and verifying that /etc/update-manager/release-upgrades is set to prompt for LTS versions. It then runs do-release-upgrade -c to check if a newer LTS version is available. If an upgrade is available, the evaluation phase exits with a status indicating that remediation should proceed.

  2. Remediation phase: The Worklet validates prerequisites including LTS configuration, pending package updates, and reboot status. If pending package updates exist, it runs apt upgrade -y to apply them. The Worklet then maintains update-manager-core is installed and executes do-release-upgrade -f DistUpgradeViewNonInteractive to perform the unattended upgrade. After the upgrade completes, the Worklet verifies success and checks if additional LTS versions are available for future upgrades.

Ubuntu distribution upgrade requirements

  • Ubuntu LTS endpoints (16.04, 18.04, 20.04, 22.04 LTS or later)

  • Release upgrade preferences set to LTS releases in /etc/update-manager/release-upgrades (the Worklet requires Prompt=lts)

  • All pending package updates must be applied before upgrade (the Worklet performs this with apt upgrade)

  • No pending reboot required (indicated by absence of /var/run/reboot-required)

  • Root or sudo access required to run the Worklet

  • Internet connectivity to download the LTS release packages

Expected Ubuntu distribution upgrade outcome

After successful remediation, the endpoint is upgraded to the next available Ubuntu LTS version. The Worklet updates the distribution packages, configuration files, and kernel. You should verify the upgrade by checking the version with lsb_release -a or by examining /etc/os-release.

If the Worklet detects another LTS version available after the upgrade completes, it exits without proceeding to the next upgrade. You can run the Worklet again to perform subsequent sequential upgrades until the endpoint reaches your target LTS version. The Worklet does not reboot the system automatically, so plan for a reboot window after all upgrades complete. Running the Worklet is ideal in maintenance windows or during scheduled downtime to minimize impact on production workloads.

How to validate ubuntu distribution upgrade changes

  1. Run this Worklet on a pilot Linux endpoint and review evaluation output for ubuntu distribution upgrade.

  2. Confirm Automox activity logs show successful completion and exit code 0.

  3. Verify endpoint state using checks aligned to evaluation script logic, such as source, else, exit.

  4. Validate remediation effects from script operations such as source, else, exit, then rerun evaluation for compliance.

View in app
evalutation image
remediation image

Consider Worklets your easy button

What's a Worklet?

A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklet automation scripts perform configuration, remediation, and the installation or removal of applications and settings across Windows, macOS, and Linux.

do more with worklets