4 Ubuntu LTS Upgrade Guide (20.04 โ†’ 22.04 โ†’ 24.04)

A sequential upgrade guide from 20.04 to 24.04 โ€” because skipping LTS versions is like skipping leg day: technically possible, but not recommended.

Table of Contents


๐Ÿ“– Overview

Ubuntu LTS systems must be upgraded sequentially. Direct upgrades across two LTS versions are not supported.

Upgrade path:

20.04 โ†’ 22.04 โ†’ 24.04

Always complete the first upgrade and reboot before proceeding to the next.


๐Ÿชœ 1. Pre-Upgrade Checklist

Before starting the upgrade, ensure the system is fully updated.

sudo apt update
sudo apt upgrade -y
sudo apt dist-upgrade -y
sudo apt autoremove -y

Reboot the system:

sudo reboot

๐Ÿชœ 2. Install the Upgrade Tool

Ubuntu uses the release upgrader tool.

sudo apt install update-manager-core

Check the configuration:

sudo nano /etc/update-manager/release-upgrades

Ensure this value is set:

Prompt=lts

This allows upgrades only to the next LTS version.


๐Ÿชœ 3. Upgrade to Ubuntu 22.04

Run the upgrade command:

sudo do-release-upgrade

Follow the prompts during the upgrade process.

After completion, reboot the system.

Verify the version:

lsb_release -a

Expected output:

Ubuntu 22.04 LTS

๐Ÿชœ 4. Upgrade from 22.04 to 24.04

Update packages again before starting the next upgrade.

sudo apt update
sudo apt upgrade -y

Run the upgrader:

sudo do-release-upgrade

Reboot once finished.

Verify:

lsb_release -a

Expected output:

Ubuntu 24.04 LTS

๐Ÿ› 5. Common Issues and Fixes

Issue 1 โ€” Cannot Connect to Release Server

Error:

Failed to connect to https://changelogs.ubuntu.com/meta-release-lts

Check Connectivity

ping changelogs.ubuntu.com
curl https://changelogs.ubuntu.com/meta-release-lts

Issue 2 โ€” SSL Connection Reset

Error:

curl: (35) OpenSSL SSL_connect: Connection reset by peer

Fix System Time

date
sudo timedatectl set-ntp true

Reinstall CA Certificates

sudo apt install --reinstall ca-certificates
sudo update-ca-certificates

Upgrade SSL and curl

sudo apt install --only-upgrade curl openssl

Issue 3 โ€” DNS Problems

Edit resolver:

sudo nano /etc/resolv.conf

Add:

nameserver 8.8.8.8
nameserver 1.1.1.1

Issue 4 โ€” Upgrade Not Detected

Force the upgrade:

sudo do-release-upgrade -d

This forces detection of the next release.


๐Ÿ” 6. Verify Final System

Check installed version:

lsb_release -a

Check kernel:

uname -r

๐Ÿชœ 7. Cleanup After Upgrade

Remove unused packages:

sudo apt autoremove
sudo apt autoclean

Update everything again:

sudo apt update && sudo apt upgrade

๐Ÿ“‹ Quick Upgrade Summary

1. Update system
2. Install update-manager-core
3. Run do-release-upgrade
4. Reboot
5. Repeat for next LTS

๐Ÿ’ก Notes