Upgrading your Ubuntu installation upgrades system packages, kernel versions, and security patches to the next release. The canonical tool for performing version upgrades from the terminal is do-release-upgrade , which safely updates package repositories, handles dependencies, and cleans up obsolete software. Update current system packages Before attempting a release upgrade, update all installed packages on your current version to their latest patches.

Architecture and Core Concepts

Configure release upgrade targets Check /etc/update-manager/release-upgrades to ensure your system checks for LTS or normal releases. Set Prompt=lts if upgrading between Long Term Support releases (e.g. 20.04 to 22.04), or Prompt=normal if upgrading to interim releases. Run do-release-upgrade Gotchas and troubleshooting "No new release found" - verify that the new Ubuntu version is officially released and check Prompt= in /etc/update-manager/release-upgrades . Third-party PPA entries - the upgrade process automatically disables external PPAs in /etc/apt/sources.list.d/ .

Execution Syntax and Code Implementation

Terminalbash
sed and check Prompt= in /etc/update-manager/release-upgrades
Terminalbash
sudo reboot ) before running do-release-upgrade

Risk level: caution. Review the command before running it.

Terminalbash
sudo reboot ) and verify your new version with lsb_release -a

Risk level: caution. Review the command before running it.

Gotchas and Troubleshooting Checklist

  • Permission & Access Control - verify user privilege level (sudo access or file ownership) before running commands.

  • Environment & Path Resolution - confirm environment variables and binary PATH entries match target software releases.

  • Log Diagnostics - inspect relevant system logs or application trace outputs to verify clean execution.

Following these steps provides a clean, reliable, and production-ready solution for upgrade ubuntu server or desktop from the command line.