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
- ๐ช 1. Pre-Upgrade Checklist
- ๐ช 2. Install the Upgrade Tool
- ๐ช 3. Upgrade to Ubuntu 22.04
- ๐ช 4. Upgrade from 22.04 to 24.04
- ๐ 5. Common Issues and Fixes
- ๐ 6. Verify Final System
- ๐ช 7. Cleanup After Upgrade
- ๐ Quick Upgrade Summary
- ๐ก Notes
๐ 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
- Always backup important data before upgrading.
- Upgrades may take 30โ60 minutes depending on internet speed.
- Avoid interrupting the upgrade process.
- Ensure stable internet connectivity during the upgrade.