Upgrade a very old Ubuntu
If your Ubuntu (Kubuntu, Xubuntu, Mythbuntu, whatever-buntu) is really old, you will have to take three steps to upgrade to an up-to-date version:
- Hack the package updater (APT) to upgrade your system to the latest available in the old-releases repository (including the release upgrade manager).
- Hack the release upgrade manager to make it agree to upgrade to the next (officially unsupported) release.
- Do the actual release upgrade (and repeat).
Remember, you are only allowed to upgrade from one "normal" release to the next and from a Long Time Support (LTS) release to the next LTS release.
Set the package sources to old-releases.ubuntu.com and update
sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
sudo apt-get update && sudo apt-get dist-upgrade && sudo apt autoremove
Configure the release upgrade manager with local data
Retrieve the meta-release files
wget -O - http://changelogs.ubuntu.com/meta-release > meta-release
wget -O - http://changelogs.ubuntu.com/meta-release-lts > meta-release-lts
Edit meta-release to set all the next releases as supported
You must set Supported: 1
for each release.
Example: I was on Ubuntu 17.04 (Zesty Zapus) and set all the releases supported starting from artful.
Dist: artful
Name: Artful Aardvark
Version: 17.10
Date: Thu, 19 October 2017 17:10:00 UTC
Supported: 1
Description: This is the 17.10 release
Release-File: http://old-releases.ubuntu.com/ubuntu/dists/artful-updates/Release
ReleaseNotes: http://changelogs.ubuntu.com/EOLReleaseAnnouncement
UpgradeTool: http://old-releases.ubuntu.com/ubuntu/dists/artful-updates/main/dist-upgrader-all/current/artful.tar.gz
UpgradeToolSignature: http://old-releases.ubuntu.com/ubuntu/dists/artful-updates/main/dist-upgrader-all/current/artful.tar.gz.gpg
…
Also, check that the URLs for UpgradeTool
and UpgradeToolSignature
start with http://old-releases.ubuntu.com
(not http://archive.ubuntu.com
).
Edit /etc/update-manager/meta-release
to point on local meta-release
Replace the original URIs with URIs pointing on your local meta-release files
[METARELEASE]
URI = file:///home/chris/meta-release
URI_LTS = file:///home/chris/meta-release-lts
URI_UNSTABLE_POSTFIX = -development
URI_PROPOSED_POSTFIX = -proposed
Upgrade
sudo do-release-upgrade
sudo apt-get update && sudo apt-get dist-upgrade && sudo apt autoremove
Reboot when asked to.
Redo it until your system is up to date.
When asked, answer that you want to keep your edited version of /etc/update-manager/meta-release
excepted on the last upgrade.
When you are stuck to an old release
The process described above worked for me to upgrade to an unsupported release, and then to the last LTS release and I couldn't upgrade anymore.
What I did: Ubuntu 17.04 (Zesty Zapus) → Ubuntu 17.10 (Artful Aardvark) → Ubuntu 18.04 (Bionic Beaver)
Then I found the -p
(--proposed
) option of do-release-upgrade
.
do-release-upgrade -p
It tries to upgrade to the newest available release! And it worked: I skipped two releases and jumped directly from Ubuntu 18.04 (Bionic Beaver) to Ubuntu 19.10 (Eoan Ermine)!
Maybe it would have worked to upgrade Ubuntu 17.04 (Zesty Zapus) to Ubuntu 19.10 (Eoan Ermine) in one run.
http://old-releases.ubuntu.com/ubuntu/
tohttp://us.archive.ubuntu.com/ubuntu/
(or your own respective two letter abbreviated county code at the beginning) starting from 17.10 (essentially in sync with going back to the beginning of the alphabet).us.archive.
did not work, butold-releases.
did.sudo do-release-upgrade
.