48

I'm trying to upgrade from 18.10 to 19.10, using sudo do-release-upgrade however I only get an error: An upgrade from 'cosmic' to 'eoan' is not supported with this tool.

I performed the steps to update my sources.list to point to old-release server, as suggested here: How to install software or upgrade from an old unsupported release?

This did not help. I get the same error.

slm
  • 3,035
Droopycom
  • 589
  • 2
    There is no upgrade path where you can skip releases (besides lts to lts). You will need to install 19.10. If I was you I would wait a couple of weeks and go for 20.04. – Rinzwind Feb 04 '20 at 22:29
  • 1
    What do you mean by install 19.10 ? You mean a full install and not upgrade ? What about installing 19.04 first ? Is that possible ? – Droopycom Feb 04 '20 at 22:33
  • 1
    @Rinzwind is correct - you missed the window of supported upgrades (18.10 to 19.04, and later 19.04 to 19.10). Sorry. You can research how to try an unsupported upgrade. If that goes wrong, then the advice you will get here is a (supported) clean-install of 19.10. Regardless of what you choose, a complete backup of all data that you consider valuable would be wise. Tip: I mark my calendar so my upgrades are within the window and smooth. – user535733 Feb 04 '20 at 22:43
  • All the research I've done pointed me back to https://askubuntu.com/questions/91815/how-to-install-software-or-upgrade-from-an-old-unsupported-release. Your answer suggest that the answer in there about the upgrade from old release is actually invalid. I haven't found any "unsupported" way to do the release, which I would be ok with. It worked a couple weeks ago (upgraded anther machine from 18.10 to 19.04) so unless some important SSL certificate expired since, I would feel fairly confident the process should still work... – Droopycom Feb 04 '20 at 22:55
  • @Rinzwind How does waiting for 20.04 help here ? I'm now under the impression that since my current release (18.10) is EOL then it would not upgrade to 20.04 either. – Droopycom Feb 04 '20 at 22:58
  • 1
    Rinzwind was saying do an install, not upgrade. A clean install of 19.10 now or wait a bit till 20.04 beta comes out, will be the easiest, if you have backups. There are some work arounds to upgrade, but they re not dependable. 20.04 will be supported for at least 5 years, 19.10 only for maybe 5 months(?) now. – crip659 Feb 04 '20 at 23:20
  • I did an upgrade from 16.04 direct to 19.10 but it wasn't easy. Firstly you should perform upgrade on a clone: https://askubuntu.com/questions/1028604/bash-script-to-backkup-clone-ubuntu-to-another-partition/1028605#1028605 Then what I did was here: https://www.linuxbabe.com/ubuntu/upgrade-ubuntu-18-04-to-ubuntu-19-10-from-command-line – WinEunuuchs2Unix Mar 08 '20 at 21:23
  • 3
    @Rinzwind "There is no upgrade path where you can skip releases (besides lts to lts)." Note that this isn't accurate in general. Skipping unsupported releases to get from one supported release to another supported release is officially supported and even automatically offered. The issues in this question are that (a) 18.10 had already itself been unsupported for about seven months and, even more importantly, (b) there was never a time when 18.10 was supported but 19.04 wasn't, so skipping over 19.04 to get from 18.10 to 19.10 was never supported. – Eliah Kagan Jun 27 '20 at 18:26

6 Answers6

71

It's still possible to do the upgrade, you just have to hack some files per this blog post in order to upgrade to 19.04 first. I was able to upgrade successfully following his method.

Quoting the blog:

  1. Run 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.
  2. As root, go in to /var/lib/update-manager and copy the file meta-release to a new file meta-release2. This file was downloaded by do-release-upgrade from the Internet and tells the upgrader how to upgrade.
  3. Edit meta-release2. Remove all entries for eoan entirely. Modify the disco entry so it says Supported: 1
  4. 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") To read 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.)
  5. Run do-release-upgrade. It should now be doing an upgrade 18.10 → 19.04. Let that run as normal and reboot.
  6. Congratulations! You’re now running 19.04. Remove the /var/lib/update-manager/meta-release2 you made.
  7. 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.
  • 4
    In my case I got a FileNotFoundError: [...]/.cache/update-manager-core/meta-release2'. To fix this just create a meta-release2 file with all the edits (Step 3) from the meta-release file in your cache directory. – jonasstaehle Feb 25 '20 at 19:11
  • 1
    @xeddo Brilliant – Novicegrammer Feb 25 '20 at 20:44
  • 1
    This is an incredibly helpful post. It should be accepted as the answer! – Andrzej Wąsowski Mar 12 '20 at 17:36
  • 2
    Not only is this an incredibly helpful post, it actually does what I did expect do-release-upgrade to do. – Daniel F Mar 12 '20 at 21:19
  • @DanielF I know... annoying isn't it? – Nicolas Holthaus Mar 12 '20 at 21:26
  • Didn't work for me. I get the message "Upgrades from 18.04 on the i386 architecture are not supported at this time". Still, thanks a lot, I was worth giving a try. – Clon Mar 17 '20 at 11:47
  • 4
    Hey, that's my blog! Glad it's helping people; I've gotten lots of reports the notes I wrote up are helpful. Enjoy all that sweet Stack Reputation :-)

    Clon, Ubuntu stopped supporting 32 bit i386 with 18.04. You really can't upgrade.

    – Nelson Mar 24 '20 at 01:11
  • @Nelson all props to you man, just trying to share the goodness you discovered. Happy to change my answer to better attribute your blog. – Nicolas Holthaus Mar 24 '20 at 02:17
  • 1
    nah it's all good. Information wants to be free. – Nelson Mar 25 '20 at 14:01
  • 9
    Starting somewhere in April 2020, one additionally needs to change the bionic or links from http://archive.ubuntu.com to http://old-releases.ubuntu.com/ inside the meta-release2 and the /etc/apt/sources.list files. Otherwise you get a 404 upon do-release-upgrade. – ikaerom Apr 25 '20 at 11:29
  • 1
    I ran into the same problem as @xeddo is describing, something about missing file or files. As I recall the file was meta-release2 and it was missing from .cache inside my home directory. The operation got stuck in the middle of what seemed like a log file, I was not taken back to the prompt. I remedied this by aborting with Ctrl+C and then running sudo do-release-upgrade. Before that I did only do-release-upgrade. So be sure to sudo your way up to the next release. – Samir Apr 28 '20 at 10:12
  • @samir you and xeddo just didn't follow the instructions closely enough. You're supposed to create the meta-release2 file in step 2.... – Nicolas Holthaus Apr 28 '20 at 19:24
  • I don't know about xeddo, but I know I did cp meta-release meta-release2 so I made a copy, and then modified the MetaRelease.py file to use the 2nd version. This was all according to plan, I'm sure of it. – Samir Apr 29 '20 at 07:53
  • @NicolasHolthaus I did follow the instructions exactely and I did create the meta-releas2 file in /var/lib/update-manager. But in my case the error pointed to the file missing in the .cache directory, not to the originally created file. – jonasstaehle Apr 29 '20 at 17:45
  • I took the time to re-do the whole thing. I'm working with VMs so it's relatively easy to do so. I can confirm that failure to sudo results in unhandled exceptions and I have the screenshots to prove it. This is simply remedied by sudo do-release-upgrade or possibly by running everything in a secure shell with sudo -i. – Samir Apr 29 '20 at 20:47
  • For what it's worth, I have added troubleshooting instructions and my screenshots as a new section to the original answer. – Samir Apr 30 '20 at 17:23
  • 1
    I did all the above-mentioned steps as well as @Moreaki 's input about changing links in the meta-release2 and /etc/apt/sources.list files. I have Docker ( version 19.03.6 ) installed and the upgrade fails every time with "W:Updating from such a repository can't be done securely, and is therefore disabled by default., W:See apt-secure(8) manpage for repository creation and user configuration details., E:The repository 'https://download.docker.com/linux/ubuntu sylvia Release' does not have a Release file" Can someone guide me with how I should proceed now? – SMcCK May 08 '20 at 09:52
  • 2
    I followed those steps and still got the exact same error message ("an upgrade from '...' to '...' is not supported with this tool"). However, running with sudo, i.e. sudo do-release-upgrade, caused the right files to be picked up. – Cedric Reichenbach Oct 11 '20 at 22:34
  • 8
    Additionally, I had to replace the line self.metarelease_information = f by self.metarelease_information = open(self.METARELEASE_FILE + "2", "r") (since the server doesn't always seem to report 304 even on subsequent runs). – Cedric Reichenbach Oct 12 '20 at 11:13
  • What can be done when disco 19.04 is EOL as well ? – neobie Jan 29 '21 at 14:17
  • 1
    @neobie Then it's one more step to go, I just did an upgrade 18.10 -> 19.04 -> 19.10 -> 20.04 LTS. You might want to take a look at the more recent answers as they promise a simpler way to do so. – Fabian Horlacher Jan 31 '21 at 23:02
19

Upgrading to 19.04 is straightforward as suggested by sysopch on a blog

  1. mkdir /tmp/upgrade
  2. cd /tmp/upgrade
  3. wget http://old-releases.ubuntu.com/ubuntu/dists/disco-updates/main/dist-upgrader-all/current/disco.tar.gz
  4. tar -xf disco.tar.gz
  5. python3 ./dist-upgrade.py

Tried it out myself - worked like a charm. After this do-release-upgrade seems to not error out, but I did NOT upgrade to 19.10 myself (I'm happy with 19.04).

In step 5 I had to **sudo** python3 ./dist-upgrade.py

jarm
  • 291
  • 1
    I found the same and it worked – Shimon Doodkin Mar 09 '20 at 09:52
  • 2
    be aware that 20.04 will be out soon and once that happens you may find it impossible to upgrade from 19.04. You may want to upgrade to 19.10 soon. – Nelson Mar 24 '20 at 01:15
  • 2
    The archive.ubuntu.com link is now dead, use this instead: http://old-releases.ubuntu.com/ubuntu/dists/disco-updates/main/dist-upgrader-all/current/

    Worked ok for me.

    – omglolbah May 19 '20 at 10:16
  • After downloading the version I needed, I needed to to a mass find and replace to replace archive.ubuntu.com and security.ubuntu.com with old-releases.ubuntu.com then I could run the upgrader. – Get Off My Lawn Jan 07 '21 at 01:01
  • Works like a charm! Jan 2021. – Reza Hajianpour Jan 21 '21 at 13:32
  • The accepted answer doesn't work for me (upgrading from 20.10 in jan 2022) because Groovy isn't on old-releases.ubuntu.com (beats me where they're putting them now...). This is working perfectly (well except for the fact that I need to add space to my /usr filesystem...) – Auspex Jan 05 '22 at 14:23
  • 1
    I tried this method today and it upgraded from cosmic to disco without a hitch. Now I'm gonna try moving up eoan version to see what happens – Christopher Thomas Aug 16 '22 at 13:49
  • 1
    It works between disco and eoan too. Focal is apparently the last LTS, so I don't need to do this method to upgrade this version. However in the future, I think this pattern is gonna work for a general situation. – Christopher Thomas Aug 16 '22 at 14:16
  • Feb 2023 here, I used this to successfully upgrade an Ubuntu 19.04 (disco) to 19.10 (eoan). Thank you Nelson! – Judah Himango Feb 23 '23 at 20:01
6

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:

  1. You can only do this via set of steps: 18.10 (cosmic) -> 19.04 (disco) -> 19.10 (eoan) -> 20.04 (focal)

  2. 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

  1. Using command line (not UI) do:
  • sudo apt update
  • sudo apt upgrade
  • sudo apt autoremove
  • and reboot
  1. 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:
  • do-release-upgrade

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 "disco" and change "cosmic" & "disco" supported flag from "0" to "1" ie:

Dist: cosmic

...

...

Supported: 1

...

...

Now back to 4

4c. You need to install update sw: sudo apt install ubuntu-release-upgrader-core

Now back to 4

  1. Redo: do-release-upgrade

Keep in mind you could end up going back to 4b.

If all goes ok then go to (6)

  1. 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.

  1. 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

zebity
  • 371
  • 1
    Definitely best answer: worked like a charm on a Lubuntu 18.10 --> 20.04. Thank you! – caneta Jun 04 '20 at 07:11
  • What do you mean with "Editing should be remove all releases after cosmic"? My file has a long list and cosmic is in the middle... Thanks a lot for a short reply :-) – Christoph Jun 05 '20 at 10:20
  • 1
    From here these lines were crucial:

    Required

    deb http://old-releases.ubuntu.com/ubuntu/ CODENAME main restricted universe multiverse deb http://old-releases.ubuntu.com/ubuntu/ CODENAME-updates main restricted universe multiverse deb http://old-releases.ubuntu.com/ubuntu/ CODENAME-security main restricted universe multiverse

    – Christoph Jun 05 '20 at 12:52
  • Sorry, I am not an expert, but I also needed sudo apt-get update, sudo apt-get dist-upgrade and sudo do-release-upgrade from the same link as in the above comment. But thanks for your explanations - it works :-) – Christoph Jun 05 '20 at 13:44
  • 1
    didnt work for me. ~/.cache/update-manager-core/meta-release didn't exist – jonathan Jun 11 '20 at 07:57
  • Christoph & Jonathan - Step 4b should be to remove all releases after "disco" and changing both "disco" & "cosmic" supported flag to 1. Also if you cannot find .cache directory in ~/.cache then maybe look in var/lib/update-manager or if your are on LTS then you will likely find "meta-release-lts:. NOTE: 1 have retested and documented more completely here: https://tips.graphica.com.au/upgrading-from-retired-ubuntu-releases/ – zebity Jun 25 '20 at 11:04
5

Had the same question. After some researching (thought you can upgrade upwards anyhow you want) found this ubuntu help page.

For further stability of a LTS release there is a slight change in behaviour if you are currently running a LTS version. LTS systems are only automatically considered for an upgrade to the next LTS via do-release-upgrade with the first point release. So for example 14.04 will only upgrade once 16.04.1 is released. If you want to update before, e.g. on a subset of machines to evaluate the LTS upgrade for your setup the same argument as an upgrade to a dev release has to be used via the -d switch.

We should be able to upgrade in may-june 2020 (i think) when 20.04.X is released.

Update 2020-02-20

Nevermind, the 18.04 will be fine. 18.10 is dead (unless you got a time machine or better knowledge of ubuntu internals, how upgrades are done).

All wee can is update sources.list to http://old-releases.ubuntu.com/ubuntu/ so that apt-get will be able to work.

Apparently you could update in a small time frame in the past. Current tooling (do-release-upgrade, which is a black box doing magic) can only update to latest available release.

So, as an example, you can do further updates:

  • 18.10 => 19.04 (while 19.04 is in Current, which it is not anymore, it is in End Of Life)

  • 19.04 => 19.10 (while 19.10 is in Current)

  • 19.10 => 20.04 (always? while in Current?)

  • 18.04 => 20.04 (always? while in Current?)

Links with scrapes of info

SLCH000
  • 151
  • Thanks for this. It's an eye opener for me... I've always been using the latest ubuntu releases, but I didn't understand how unsupported intermediate versions would be and how quickly. I at least figured you'd be able to upgrade! – Nicolas Holthaus Feb 24 '20 at 13:06
  • the 18.04 -> 20.04 upgrade track won't be released immediately, by the way - that usually comes closer to the first point release of an LTS that I've observed. – Thomas Ward Feb 24 '20 at 14:19
4

Find below the steps to bypass not supported upgrades.

Before the upgrade, make sure your system has the latest updates:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
# Reboot if needed.

Here is the actual workaround (by forcing all releases to be supported) by patching the file:

sudo sed -i'.bak' "s/supported = int/supported = 1|int/" /usr/lib/python3/dist-packages/UpdateManager/Core/MetaRelease.py

Note: Similar approach to accepted answer by patching MetaRelease.py file, but simplified (no file copy/renames are required).

Then run the upgrade as usual:

sudo do-release-upgrade

To upgrade to another release after the it's finished, repeat the above command again.

Notes:

  • Above tested by upgrading Ubuntu

    • from 19.04 (Disco Dingo) to 19.10 (Eoan Ermine) (as of Oct 2020).
    • from 19.10 (Eoan Ermine) to 20.04 (Focal Fossa) (as of Oct 2020).
  • If you're logged as root, you don't need to prefix commands with sudo.

  • If you're doing the remote upgrade, it's safer to run command using screen, e.g. sudo screen do-release-upgrade (so the upgrade won't stop on connectivity issues).

kenorb
  • 10,347
  • This sed instruction seems to make things work perfectly. Already done cosmic to disco, disco to eoan was just login, sed and do-release-upgrade to get going again. – Kaithar Jul 21 '21 at 23:03
0

I successfully upgraded directly from 16.04 to 19.10 but I didn't do this on my production system I did it on a test system:

I used the instructions from:

In a nutshell the article rather than "upgrading" you trick the system into thinking current version is 19.10 and perform a regular "update":

We need to run the following command to change all instances of cosmic to eoan in the source list file (/etc/apt/sources.list). Cosmic is the code name for Ubuntu 18.10, whereas eoan is the code name for Ubuntu 19.10.

sudo sed -i 's/cosmic/eoan/g' /etc/apt/sources.list

Then we need to disable third-party repositories (PPAs) with the command below.

sudo sed -i 's/^/#/' /etc/apt/sources.list.d/*.list

Keep in mind I had errors that required required running of sudo apt clean and sudo apt install -f afterwards. Sometimes I had to do this a couple of times after fixing other error messages. Luckily google search and answers in Ask Ubuntu helped me get the job done.