Monday, June 18, 2018

Why does `do-release-upgrade` skip a version?


I answered this question about do-release-upgrade not allowing an upgrade of 14.10 to 15.04 only to 15.10, I assumed it was due to 15.04 being end of life.


A user (@xangua ) posted that it was not possible to skip a release with do-release-upgrade, so I looked in to this information by running the command on my 14.04 box, but this is where the confusion began.


My 14.04 wants to upgrade straight to 15.04?


Of course this invalidates my answer as 15.04 is end of life, but why does this command seem to be skipping versions, if not based on end of life?


There is no indication any thing from 14.10 is being downloaded by the upgrade and software-updater says Ubuntu 15.04 is now available for download, some clarification of this would be great.



Your original guess was right. 15.04 is supported through 2016-02-04, so do-release-upgrade is trying to upgrade you to the next supported release compared to the one you have.


Here's the description of normal upgrade prompting mode from /etc/update-manager/release-upgrades:



Check to see if a new release is available. If more than one new release is found, the release upgrader will attempt to upgrade to the release that immediately succeeds the currently-running release.



So if I'm on 14.04 it should be trying to take me to 14.10, but right now do-release-upgrade is trying to take the OP (and me) to 15.04 instead.


So reading through /usr/lib/python3/dist-packages/DistUpgrade/MetaRelease.py it looks like we skip unsupported releases when figuring out what release to upgrade to (unless you're using the developer flag):


    # then see what we can upgrade to
upgradable_to = ""
for dist in dists:
if dist.date > current_dist.date:
# Only offer to upgrade to an unsupported release if running
# with useDevelopmentRelease, this way one can upgrade from an
# LTS release to the next supported non-LTS release e.g. from
# 14.04 to 15.04.
if not dist.supported and not self.useDevelopmentRelease:
continue
upgradable_to = dist
self._debug("new dist: %s" % upgradable_to)
break

I should add that I do not recommend trying to get around this with do-release-upgrade -d. When I tried it with prompt=normal, I got 404s, since 14.10 is EoL. I also think in my delirium I must have tried do-release-upgrade -p, which tried to take me straight to 16.04. By the time I realized it was taking me to xenial everything was broken and I had to restore from factory. In the end I decided I'll wait until 16.04 is released and do a fresh install.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...