If you've found yourself stuck on an End-of-Life (EOL) Ubuntu release like 23.04, you might have encountered frustrating errors when trying to upgrade to newer versions. While the standard do-release-upgrade
command typically handles upgrades smoothly, it won't work once your release has reached EOL status. Don't worry though - there's still a way to upgrade without reinstalling your system!
The Problem
When trying to upgrade an EOL release, you might see errors like:
An upgrade from 'lunar' to 'noble' is not supported.
Or when using the development flag:
Upgrades to the development release are only available from the latest supported release.
Let's Fix It!
- First, back up your data! While this process is generally safe, it's always wise to have backups before any major system upgrade.
- Create a new directory and download the version-specific upgrader. For an upgrade to 23.10 (Mantic), use:
mkdir upgrader cd upgrader wget http://old-releases.ubuntu.com/ubuntu/dists/mantic-updates/main/dist-upgrader-all/current/mantic.tar.gz
- Extract and run the upgrader:
tar -xaf mantic.tar.gz sudo ./mantic
Note: If the upgrade fails, don't give up immediately! Some users have reported success after multiple attempts - in one case, it mysteriously worked on the fifth try. This might be due to temporary network issues or repository status changes.
Common Issues and Solutions
If you're getting 404 errors, you'll need to update your sources to use the old-releases repository:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo sed -i 's/archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
sudo sed -i 's/security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
sudo apt update
Before upgrading, ensure your system has enough space and is in a consistent state:
# Check disk space
df -h /
# Clean up old packages
sudo apt clean
sudo apt autoremove
# Check for broken packages
sudo dpkg --configure -a
sudo apt install -f
If you encounter package conflicts during the upgrade:
# List held packages
dpkg --get-selections | grep hold
# Remove package holds
sudo apt-mark unhold package_name
# List broken packages
sudo apt-get check
For LTS Upgrades
If you're aiming for an LTS release like 24.04, you'll need to perform the upgrade in steps:
- First upgrade to 23.10 using the method above
- Reboot your system
- Then upgrade to 24.04 using the standard
do-release-upgrade
command
Having trouble? Check the upgrade logs at /var/log/dist-upgrade/main.log
and /var/log/dist-upgrade/apt.log
for detailed information about what might have gone wrong. Remember that persistence might pay off - if the upgrade fails, try running it again after a few minutes.
While it's generally recommended to keep your Ubuntu system updated before it reaches EOL, sometimes circumstances prevent this. This method provides a way to upgrade your EOL system without requiring a fresh install.