Cannot upgrade from disco 19.04 to focal 20.04 after end of life using do-release-upgrade method

34,588

Solution 1

This is the only instruction which helped me: Upgrading End of Life (EOL) Ubuntu Version Ubuntu 19.04

Quoting from the above link:

~# nano /etc/apt/sources.list

I got stuck trying to update php 7.2 to 7.4 because my Digital Ocean server was on an older version of Ubuntu.

If I tried to update my release I'd get the following

# do-release-upgrade
Checking for a new Ubuntu release
Your Ubuntu release is not supported anymore.
For upgrade information, please visit:
http://www.ubuntu.com/releaseendoflife

Please install all available updates for your release before upgrading.

When attempting to update my packages with apt-get update I would get these types of errors.

Err:5 http://mirrors.digitalocean.com/ubuntu disco Release
  404  Not Found [IP: 172.67.168.253 80

E: The repository 'http://mirrors.digitalocean.com/ubuntu disco Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

These occur because my Ubuntu version is not only out of date but at its end of life so updating Ubuntu to a newer version.will require me to update my repositories.

Digital Ocean uses its own mirrors for repositories so there is a little more work there in figuring out which ones to use.

What version of Ubuntu am I on?

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 19.04
Release:        19.04
Codename:       disco

What repositories are being used?

~# nano /etc/apt/sources.list

Example repoistory on Digital Ocean Ubuntu 19.04

deb http://mirrors.digitalocean.com/ubuntu/ disco main restricted

Let's first get our current Ubuntu version up to date

To make the server update the files, we had to edit the /etc/apt/sources.list with working repository locations.

To goal here, on this Digital Ocean server is to update the urls they use for the repositories with ones you that will have the files you need for your update

We want to replace this urls

mirrors.digitalocean.com

with

old-releases.ubuntu.com

This command will work

sudo sed -i -e 's/mirrors.digitalocean.com/old-releases.ubuntu.com/g'

/etc/apt/sources.list

Now

sudo apt-get update

will work!

Let's keep going

sudo apt-get upgrade -y
sudo apt-get dist-upgrade

Try to upgrade Ubuntu on the command line.

We are still unable to upgrade via do-release-upgrade

# do-release-upgrade

Checking package manager

Can not upgrade

An upgrade from 'disco' to 'focal' is not supported with this tool.

Frack!

So now I have my current outdated version of Ubuntu up to date, but I can't upgrade to the next version using do-release-upgrade

You can try to upgrade manually.

First go to https://changelogs.ubuntu.com/meta-release and scroll down to the release you want to upgrade to.

For example if you want to upgrade to Ubuntu 19.10 Eoan scroll to you find the url to the UpgradeTool

UpgradeTool: http://old-releases.ubuntu.com/ubuntu/dists/eoan-updates/main/dist-upgrader-all/current/eoan.tar.gz

Now pull this over to a directory on your server

wget http://old-releases.ubuntu.com/ubuntu/dists/eoan-updates/main/dist-upgrader-all/current/eoan.tar.gz
mkdir eoan_upgrade
tar -xvzf  eoan.tar.gz -C eoan_upgrade

cd eoan_upgrade

Run the upgrade script

sudo ./eoan
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade

Solution 2

Faced the same problem after end of life. The process to upgrade to 20.04 was first to upgrade to 19.10. Following is how I upgraded 19.04 to 19.10

  1. Open /etc/apt/sources.list
  2. Delete everything and replace it with the following: (you might want to keep a backup just in case)
deb http://old-releases.ubuntu.com/ubuntu eoan main 
deb http://old-releases.ubuntu.com/ubuntu eoan-updates main 
deb http://old-releases.ubuntu.com/ubuntu eoan-security main 
  1. Finally, just run these commands one by one:
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade

That's basically it. Ubuntu should now be upgraded to 19.10 (Eoan)

Now it is an easy task to upgrade from Eoan to Focal (20.04)

As suggested by @xiaojueguan, run the following command to upgrade from Eoan to Focal:

do-release-upgrade

Note: After you update to Eoan, you may want to update your sources.list file. You can find it here:

Eoan (Ubuntu 19.10): https://gist.github.com/malikalichsan/860b8134a74c65a394efe09711d0b95f

Focal (Ubuntu 20.04): https://gist.github.com/ishad0w/788555191c7037e249a439542c53e170

Solution 3

Summary:

Do an intermediary upgrade disco=>eoan=>focal


Alternate upgrade

  1. I tried part of @misteeque solution and changed all the /etc/apt/sources.list to old-release. So, can't tell if this had an impact on the steps below. I also did the http://security... ones. Comment if 0. is not needed.
  2. sudo wget http://old-releases.ubuntu.com/ubuntu/dists/eoan-updates/main/dist-upgrader-all/current/eoan.tar.gz
  3. sudo mkdir eoan_upgrade && sudo mkdir eoan_upgrade
  4. cd eoan_upgrade
  5. sudo ./eoan
  6. sudo do-release-upgrade and do 5. again to get to focal

lsb_release -a is helpful to check pre and post upgrades.

Share:
34,588
KingWm
Author by

KingWm

Updated on September 18, 2022

Comments

  • KingWm
    KingWm almost 2 years

    At this time, I am unable to update from Disco 19.04 to Focal 20.04. I have read several current questions that have been closed, referring to some really old questions. I have already read all the 8 year old threads and followed those instructions. They were helpful but they don't solve my problem. I have read all the questions suggested to me while typing this. Please don't close my thread and refer to the old ones as they do not resolve this issue, which is NEW (as in, it has been 8 years already since those questions were answered and they don't address my problem).

    After trouble shooting and replacing "archive" with "old-releases" and eliminating all the third party packages from the source list, I am able to "apt update" and "apt upgrade" and the system is up to date.

    I have tried "full-upgrade", "dist-upgrade" and everything else I can think of. All now say:

    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    

    I already fixed all the error messages I was getting using all the suggestions in all the other threads I have already read.

    When I run "do-release-upgrade", I get the following output:

    Checking for a new Ubuntu release 
    Your Ubuntu release is not supported anymore. 
    For upgrade information, please visit: http://www.ubuntu.com/releaseendoflife
    
    Get:1 Upgrade tool signature [1,554 B]
    Get:2 Upgrade tool [1,337 kB]
    Fetched 1,338 kB in 0s (0 B/s)
    authenticate 'focal.tar.gz' against 'focal.tar.gz.gpg' 
    extracting 'focal.tar.gz'
    Reading cache
    Checking package manager
    Can not upgrade 
    An upgrade from 'disco' to 'focal' is not supported with this tool.
    

    When I user the Software Upgrade graphical tool, I get the following:

    Can not upgrade: An upgrade from 'disco' to 'focal' is not supported with this tool.
    

    This computer has many users and much software loaded and I cannot do a fresh install. First, I don't know how to do so while saving all the users, files and programs and second, I foresee a nightmare scenario of a blown up computer with everything gone.

    If I can upgrade from 19.04 to 19.10, I have been unable to figure it out. I am pretty sure it can't be done since 19.04 is no longer supported.

    In case it matters, my disk is encrypted.

    Please, please, please someone tell me there is a way to get from 19.04 to 20.04 without a fresh install, saving all my users, data and programs! I would be absolutely shocked if there is no way to upgrade simply because I missed the update deadline. If not, I will be forced to buy a new computer!

    • Admin
      Admin almost 4 years
      Personally I'd opt for a re-install, non-destructive (ie. using same partitions with no format of partitions) where it'll note your software packages, erase system directories, install, add back your additional software packages & ask to reboot. That works brilliantly & is many times faster than a release-upgrade for desktops, however it can have draw backs for servers (that can stored config files in system directories that get wiped; desktop apps store files in $HOME so aren't touched). Backup of course first, and use a LTS if you don't like upgrading every 6-9 months as @user535733 said
    • Admin
      Admin almost 4 years
      Those 8-9 year old posts don't answer my question. I know you can't or are not supposed to skip releases but I cannot upgrade to 19.10 either. I was looking for suggestions for alternatives. I didn't realize when I installed 19.04 and missed the deadline for auto upgrades that it made it impossible to upgrade at all. Otherwise, I certainly wouldn't have missed the deadline. I wish it were more clear that missing a deadline with a developmental release would cause this problem. It's not friendly to new users. I guess I will have to learn how to backup and restore and do a fresh install.
    • Admin
      Admin almost 4 years
      I was able to modify the instructions found at this link to successfully upgrade from 19.04 to 19.10: tips.graphica.com.au/upgrading-from-retired-ubuntu-releases
    • Admin
      Admin almost 4 years
      @JonathanBerger We already have a similar Q&A. It is considered as a highly active Q&A and the highest voted answer helped at least 200 people (considering visible and invisible votes) and I awarded bounty for that excellent answer. It was unfotunate that this question wasn't closed as dupe of that one. Would you like to suggest an edit on the above said question so that, as you say, googlers would get benefit? By the way, thanks for your concern. Appreciated!!!
    • Admin
      Admin over 3 years
      The answer by Stalinko seems to be the best one - directly download and call the dist-upgrade tool
    • Admin
      Admin over 3 years
      update to eoan first by adding following lines to sources.list ubuntu will then choose mirror which is closest to you -> faster download deb mirror://mirrors.ubuntu.com/mirrors.txt eoan main restricted universe multiverse deb mirror://mirrors.ubuntu.com/mirrors.txt eoan-updates main restricted universe multiverse deb mirror://mirrors.ubuntu.com/mirrors.txt eoan-backports main restricted universe multiverse deb mirror://mirrors.ubuntu.com/mirrors.txt eoan-security main restricted universe multiverse sudo apt update sudo apt dist-upgrade Now it should be a easy to update to focal
    • Admin
      Admin over 3 years
      @JonathanBerger Could you be kind enough to expand your comment and add it as an answer to this question? Thanks.
    • Admin
      Admin over 3 years
      @jokerdino Sorry, the steps I've taken have since faded from memory and I'd hate to add inaccurate information. It's also frustrating to me it took so long for this post to be unlocked.
    • Admin
      Admin over 3 years
  • Ubuntu-user_bear
    Ubuntu-user_bear over 3 years
    the above upgrade script doesn't work for me. I tried the wget with the tar command and neither worked so is there a solution?
  • Stalinko
    Stalinko over 3 years
    What's the exact issue with wget and tar? Does it throw any errors?
  • GSUgambit
    GSUgambit over 3 years
    is there a reason your post talks about going to 20 but in the example you are upgrading to 19.10? Do you have to go to 19.10 before going to 20.04?
  • GSUgambit
    GSUgambit over 3 years
    nevermind i see the last command, you are going to 19.10 because its supported then doing a dist upgrade to 20
  • GSUgambit
    GSUgambit over 3 years
    @Stalinko i assume your problem is your didnt change it to "old-releases" in the archive and you copied and pasted the one from the meta-release website he linked to
  • GSUgambit
    GSUgambit over 3 years
    last line should be do-release-upgrade instead of sudo apt dist-upgrade though
  • Artur Meinild
    Artur Meinild over 3 years
    This is not the "official" way to upgrade, but it might work.
  • misteeque
    misteeque over 3 years
    Yes, it's not official at all. However, as far as I understand, after EOL there isn't any official way. I found this to be the easiest way to go though :)
  • Sai
    Sai about 3 years
    Then sudo do-release-upgrade to upgrade to ubuntu 20.x.x
  • Hillsie
    Hillsie about 3 years
    Part of your solution worked for me. Important highlight. Do an intermediary update disco=>eoan=>focal <br>
  • misteeque
    misteeque almost 3 years
    Yeah, if you read the first line, it says first upgrade from 19.04 (disco) to 19.10 (eoan)
  • Admin
    Admin about 2 years
    For posterity, I was able to do disco -> eoan -> focal -> jimmy with this method. It took a fair amount of time, but it was successful.
  • Admin
    Admin about 2 years
    when you've upgrade to 19.10(eoan), type do-release-upgrade and follow the tutorial and you will be there