Update (March 2020): I’ve heard from 10+ people who say these instructions work for them, I think it’s reliable. See also this Ask Ubuntu post. Some folks are finding their way to this blog searching for “An upgrade from ‘cosmic’ to ‘eoan’ is not supported with this tool.” That makes sense, it’s the error the upgrade tool gives. Finally, if you see an error about “Upgrades from 18.04 on the i386 architecture are not supported” that is sadly true; 32 bit support stopped in 18.04. I don’t know how to help you with that.
A couple of weeks ago I blogged about being unable to upgrade from Ubuntu 18.10 (cosmic) to 19.10 (eoan), or even 19.04 (disco). Ubuntu 18.10 is fully end of life and deprecated and the do-release-upgrade tool we normally use to upgrade things refused to run. (Note that this tool is bundled in the ubuntu-release-upgrader-core package) Fortunately one of my readers Alejandro saw my post and suggested a solution. I just tried it and it works. Details below.
The underlying problem is do-release-upgrade on 18.10 was trying to upgrade directly from 18.10 → 19.10. But that’s not possible. And it’s no longer possible to upgrade 18.10 → 19.04 because 19.04 is also not supported. So you’re stuck.
The gist of the solution is to hack a config file to force an 18.10 → 19.04 update. It turns out Ubuntu’s do-release-upgrade tool is a generic program, the version installed on an 18.10 system is not 18.10 specific. Instead it downloads metadata files from the Internet and uses those to figure out what to do. Alejandro’s suggestion boils down to intercepting those metadata files after download and hacking them to point to 19.04 instead of 19.10. The packages needed to do the 18.10 → 19.04 upgrade are still online, do-release-upgrade just wasn’t finding them.
Needless to say, the instructions below come with a big warning this may break your system. It worked for me, but no idea if it will work for you.
18.10 → 19.10 steps
- zRun do-release-upgrade on the 18.10 system. This will give you an error about being unsupported. But behind the scenes, the tool will download some metadata files we want to modify.
- As root, go in to
/var/lib/update-managerand copy the file
meta-releaseto a new file
meta-release2. This file was downloaded by do-release-upgrade from the Internet and tells the upgrader how to upgrade.
meta-release2. Remove all entries for eoan entirely. Modify the disco entry so it says
Update April 2020: reader F.K. write to say “I found that ubuntu repo returns 404 and `do-release-upgrade` can’t run update. I changed all link in meta-release2 for disco to http://old-releases.ubuntu.com/ and its works.” I can’t test this but it seems plausible of Ubuntu finally moved the disco update files out of the live repo (say, in preparation for the 20.04 release.)
- Edit the file
/usr/lib/python3/dist-packages/UpdateManager/Core/MetaRelease.py. Change this line of code
self.metarelease_information = open(self.METARELEASE_FILE, "r")
self.metarelease_information = open(self.METARELEASE_FILE + "2", "r")
That will tell the upgrader to use your modified file instead of the original. (It will also avoid any redownloads overwriting your changes.)
- Run do-release-upgrade. It should now be doing an upgrade 18.10 → 19.04. Let that run as normal and reboot.
- Congratulations! You’re now running 19.04. Remove the
- Since 19.10 is supported, all you have to do to upgrade 19.04 → 19.10 is run do-release-upgrade again. No hacks necessary, you’re back on the main path.
Like I said, it worked for me. I’m a little surprised Ubuntu doesn’t support this officially out of the box, it seems simple enough. I suspect they just want to have nothing at all to do with older systems. Still if it were me I’d add some flag to enable at-your-own-risk upgrades for people like me who were stuck.
I think I also could have upgraded my system simply by editing
/etc/apt/sources files and relying on apt dist-upgrade. That’s the underlying tool that’s doing all the work anyway. But the Ubuntu upgrade scripts have a little extra stuff in them and it’s nice to be able to run it just in case it’s important.
I’m very grateful to Alejandro for his emailing me the suggestion on the fix.