Comment 5 for bug 1975533

Revision history for this message
Mikolaj Buchwald (mikbuch) wrote :

@Brian Murray, if you don't mind, I will post my notes here, as comments, so that it will be easier for someone else to follow my thought process on getting familiar with the problem, i.e., getting to better know how does `do-release-upgrade` and `DistUpgrade.cfg` work.

It is very important to know all recent Ubuntu release names (https://wiki.ubuntu.com/Releases) in order to keep track with the analysis below.

Ok, so I inspected the `DistUpgrade.cfg` file (https://git.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/tree/data/DistUpgrade.cfg?h=ubuntu%2Fjammy#n109; stored in my file system at `/usr/share/ubuntu-release-upgrader/DistUpgrade.cfg`). It contains:

...
108 [Sources]
109 From=impish
110 To=jammy
...

So it represents my most recent update. (I finally did groovy=>impish, and impish=>jammy.) Then, during the next update, it would look like:

...
108 [Sources]
109 From=jammy
110 To=kinetic
...

(see: https://git.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/tree/data/DistUpgrade.cfg#n110)

I also found the `DistUpgrade.cfg.focal` (https://git.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/tree/data/DistUpgrade.cfg.focal), and it contains:

...
108 [Sources]
109 From=focal
110 To=jammy
...

Interestingly, the `DistUpgrade.cfg.focal` stored at my file system (at "~/.local/share/Trash/files/DistUpgrade.cfg.focal") contains:

...
108 [Sources]
109 From=focal
110 To=hirsute
...

E.g., it was moved to the trash when the `ubuntu-hirsute` branch was in use on my system, see: https://git.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/tree/data/DistUpgrade.cfg.focal?h=ubuntu%2Fhirsute#n109 .

---

@Brian Murray, your other suggestion was to create `demoted.cfg.groovy`. Indeed, in the https://git.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/tree/utils there is no `demoted.cfg.groovy`.

Maybe part of the simplest solution (for the others to use) is, as you suggest, to create "demoted.cfg.groovy" which contains basically the same packages as "demoted.cfg.focal".

---

Brian Murray wrote:

 > "For what its worth I tested an upgrade of a stock Ubuntu 20.10 system to Ubuntu 21.10 by copying DistUpgrade.cfg.focal to DistUpgrade.cfg.groovy and did not run into any issues"

It worked because of this piece of code: lines 44 & 45 here: https://git.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/tree/DistUpgrade/DistUpgradeConfigParser.py#n44
(
```
if os.path.exists(maincfg + "." + from_release):
    maincfg += "." + from_release
```
)

It is not a particularly neat solution, but it will work.

In the ideal world, there would be a mechanism similar to this: https://git.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/tree/DistUpgrade/DistUpgradeConfigParser.py#n39 (from_release = ...) in combination with the list of known releases (https://wiki.ubuntu.com/Releases) for the `DistUpgradeConfigParser.py` not to take fixed release names (from `DistUpgrade.cfg`/focal/groovy), but dynamically decide what is the release on the system, and what is the next available release, so that the `do-release-upgrade` would attempt to upgrade to the next available release. This way upgrades from the EOL systems would be supported, or as @Scott Carle wrote in the title of his bug report: it would be "easy peasy" (https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1745754), now upgrading from EOL is not that simple. Getting back to the technicalities: the problem now seems to be that both groovy=>impish and hirsute=>impish should be supported. With release names being fixed on the branches, it is not possible (see: https://git.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/tree/data/DistUpgrade.cfg?h=ubuntu%2Fimpish#n109). I am still missing one point: how did my groovy knew that impish was the latest supported system?

That's it for the analysis. I will try to come up with some solution (in the code) that will support upgrading from at least groovy, if not from any EOL release, to the first available, still supported release (e.g., at the moment, groovy=>impish and hirsute=>impish).