4

-- 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
  • 231
  • 1
  • 2
  • 9

1 Answers1

7

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
  • 96