3

-- Our Situation --

We haven't been able to get do-release-upgrade to run on our Ubuntu 16.04 LTS systems in the past few weeks.

We have 100+ machines to upgrade. Have read the other solutions and none of them work so far (eg: How do I upgrade to a newer version of Ubuntu? How to remove obsolete packages after failed release upgrade via do-release-upgrade on Ubuntu? How to only perform LTS upgrades? ) - that is except for the "brute force" method of manually changing the distro in /etc/apt/sources.list[.d/]* .. I'm not a fan of this method as it seems overly messy and not particularly friendly.

Is do-release-upgrade broken on 16.04LTS ? do-release-upgrade worked sometime mid last year, and now it isn't..

-- Some info.. --

* Require a command line based solution as we need to automate this.
  We will be updating over 100 machines
* None of the existing solutions get do-release-upgrade to work.
    sudo do-release-upgrade
    sudo do-release-upgrade -d
    sudo do-release-upgrade -c
* update-manager-core package is installed
* File /etc/update-manager/release-upgrades has:
    [DEFAULT]
    #...
    Prompt=lts

* File /etc/update-manager/meta-release has:
    # default location for the meta-release file
    [METARELEASE]
    URI = https://changelogs.ubuntu.com/meta-release
    URI_LTS = https://changelogs.ubuntu.com/meta-release-lts
    URI_UNSTABLE_POSTFIX = -development
    URI_PROPOSED_POSTFIX = -proposed
    /etc/update-manager/meta-release (END)

-- Error Messages --

  do-release-upgrade :
        Checking for a new Ubuntu release
        No new release found.
  do-release-upgrade -d :
        Checking for a new Ubuntu release
        Upgrades to the development release are only 
        available from the latest supported release.
   do-release-upgrade -c :
        Checking for a new Ubuntu release
        No new release found.

UPDATE #1

 * Machines are running : Ubuntu 16.04.6 LTS
 * Machines are updated every day by cron (apt update+upgrade)
 * /etc/apt/sources.list.d/ubuntu.list has : 
   deb archive.canonical.com/ubuntu xenial partner 

Bastion
  • 191
  • Are the machines fully-upgraded? (ie. to 16.04.6) The "-d" option shouldn't work (as it's for 19.10 to 20.04 which isn't what you want so error message is correct). The first error implies your 16.04 box isn't fully upgraded; next I'd check your sources point to a maintained mirror (https://launchpad.net/ubuntu/+archivemirrors) and are getting all updates; if they're far behind they may not know 18.04.1 has been released (thus first error messages; ie. No new release found). Also check they haven't been told to not release-upgrade (ie. not set to "none"; admins often do this so not bugged) – guiverc Jan 24 '20 at 05:31
  • With a new 18.04 lts release coming on 2/04 (18.04.4),you'd probably want to wait till then. Whether that's what's interfering don't know but the meta-release file does seem to be fine and the lts URI exists. ( though lists 18.04.3 – doug Jan 24 '20 at 06:03
  • what gives /usr/lib/ubuntu-release-upgrader/check-new-release -qcd – nobody Jan 24 '20 at 11:28
  • @nobody - that command gave no output – Bastion Jan 28 '20 at 00:23
  • @guiverc The machines are running "Ubuntu 16.04.6 LTS"; They're setup to automatically update packages daily (apt update/upgrade); – Bastion Jan 28 '20 at 00:31
  • @guiverc "check they haven't been told to not release-upgrade" do you mean the setting in /etc/update-manager/release-upgrades ? It is set to Prompt=lts – Bastion Jan 28 '20 at 00:36
  • @guiverc /etc/apt/sources.list.d/ubuntu.list has : deb http://archive.canonical.com/ubuntu xenial partner – Bastion Jan 28 '20 at 00:39
  • @guiverc "Does this answer your question?" - I'm afraid not. I think I've covered everything there in my post (except the last answer where it suggested burning a CD). – Bastion Jan 28 '20 at 02:12
  • Edit your question to show us your complete /etc/apt/sources.list file. – user535733 Jan 28 '20 at 02:45
  • @user535733 the sources.list file is empty except for a comment, that's why I posted the ubuntu.list file in my question (Update #1). This may well be the issue.

    I found these two sources.list files for 16.04 LTS - do they look ok to you guys? https://askubuntu.com/questions/863933/ubuntu-16-04-messed-sources-list https://gist.github.com/rohitrawat/60a04e6ebe4a9ec1203eac3a11d4afc1

    Thanks for your help

    – Bastion Jan 28 '20 at 23:20
  • 1
    Yes, missing repositories would cause the problem that you describe. Try this one: How do I restore the default repositories? – user535733 Jan 29 '20 at 01:49

1 Answers1

6

I had exactly the same problem and solved it by using the "Debian way" as described at https://linuxconfig.org/how-to-upgrade-to-ubuntu-18-04-lts-bionic-beaver.

  1. Before, I had modified my default /etc/apt/sources.list file to the one described here: https://gist.github.com/rohitrawat/60a04e6ebe4a9ec1203eac3a11d4afc1 (that step was probably useless, since my sources.list file looked fine). After that, do-release-upgrade still produced a "No new release found" message.
  2. I changed xenial to bionic in /etc/apt/sources.list (there was nothing to change in the files under /etc/apt/sources.list.d/) by running this:

    $ sudo sed -i 's/xenial/bionic/g' /etc/apt/sources.list

  3. I upgraded everything with:

    $ sudo apt update && sudo apt -y dist-upgrade

  4. And reboot

Then I was greeted with Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-76-generic x86_64) and everything seems to work fine (lsb_release -a confirms that I am using Ubuntu 18.04.4 LTS).

Note that I upgraded from 14.04 LTS to 16.04 LTS a few weeks ago with do-release-upgrade, with no problem. Also note that I am not an experienced Linux/Ubuntu user, but I hope this can help.

thbz
  • 86
  • 1
    While editing the sources.list might upgrade the release but it's not recommended. See Is editing sources.list a good idea? – Kulfy Feb 02 '20 at 07:11
  • 1
    Thanks for the link. But what I understand from reading it is that even do-release-upgrade is not a very good idea. So what I remember is that 1) either do-release-upgrade works out of the box, of 2) do a clean install instead of losing hours trying to understand what's wrong with do-release-upgrade. – thbz Feb 02 '20 at 21:06
  • @thbz - Yes. This is the only way me and my colleague have been able to get it working when upgrading from 16.04 LTS. It DID work last year. Something has changed and we don't know what. We have both tried restoring the old sources.list to their expected configuration [ie as per https://askubuntu.com/questions/124017/how-do-i-restore-the-default-repositories ] but still no success. The error stays the same. – Bastion Feb 02 '20 at 22:45
  • I may have to take this as the answer since nothing else works, although I am explicitly requesting a solution that fixes the do-release-upgrade process. We could try debugging /usr/bin/do-release-upgrade but I don't think I really have time for that .. – Bastion Feb 02 '20 at 22:45
  • This still works as the answer for last resort which I had to use because nothing else worked for me. – PanDe Oct 29 '21 at 06:43