Simpler Way: 18.10 -> 19.04 -> 19.10 -> 20.04 LTS (24 May 2020)
I got caught out on this having over 20 Ubuntu VMs on various versions from 18.04 / 18.10 / 19.04 / 19.10 .
I have tested a number of updates from 18.10 to 20.04 using variation of what is provided in prior guidance above.
Here are the high level steps:
You can only do this via set of steps: 18.10 (cosmic) -> 19.04 (disco) -> 19.10 (eoan) -> 20.04 (focal)
18.10 and 19.04 are the problem as they are "obsolete" and archive has been moved to "old-releases", so you will need to edit /etc/apt/sources.list to point to:
"deb http://old-releases.ubuntu.com/ubuntu" and not any other repository
Using command line (not UI) do:
- sudo apt update
- sudo apt upgrade
- sudo apt autoremove
- and reboot
Now you can try upgrade but first check:
/etc/update-manager/release-upgrades has "Prompt=normal" and edit if needed.
Then via command line do:
There are 3 possible results:
- a. All goes ok ;-) - then advance to (6)
- b. Get failure where is says you cannot upgrade from "cosmic" to "eoan"
- c. Get "do-release-upgrade" command not found
- d. No release found (see step 6)
4b. You need to edit the cached update list which is in: ~/.cache/update-manager-core/meta-release
Editing should be remove all releases after "cosmic" and change "cosmic" supported flag from "0" to "1"
Now back to 4
4c. You need to install update sw: sudo apt install ubuntu-release-upgrader-core
Now back to 4
- Redo: do-release-upgrade
Keep in mind you could end up going back to 4b.
If all goes ok then go to (6)
- You should now be at 19.04 or 19.10 (depending on where you started).
Now you just need to repeat the steps.
Simply repeat 4.
If get a "release not found" error then you should delete the cached releases file you edited earlier (~/.cache/update-manager-core/meta-release) and re-run.
- You should now be able to to upgrade to 20.04 LTS
NOTE 1: I am writing this from rough notes, keep while doing updates, so hope I have recalled correctly.
NOTE 2: If you have used "external PPA" in /etc/apt/sources.list.d directory, then you should disable these prior to starting the update process.
NOTE 3: I have just done an 18.04 LTS update this went: 18.04 -> 19.10 -> 20.04 . So it did not go directly from 18.04 -> 20.04 ... puzzling