~juliank/ubuntu-release-upgrader:improve-obsoletes

Last commit made on 2024-04-29
Get this branch:
git clone -b improve-obsoletes https://git.launchpad.net/~juliank/ubuntu-release-upgrader
Only Julian Andres Klode can upload to this branch. If you are Julian Andres Klode please log in for upload directions.

Branch merges

Branch information

Name:
improve-obsoletes
Repository:
lp:~juliank/ubuntu-release-upgrader

Recent commits

ae0c35f... by Julian Andres Klode

Reimplement obsolete removal with resolve_by_keep

Basically the idea is that we pass auto_fix=False to the cache
and then use resolve_by_keep() to revert any removals that cause
additional removals.

This is easier than it sounds however, as we need to pay special
attention to forced_obsoletes. As can be seen in the code, forced
obsoletes also remove additional dependencies (they do not check
the changes made by mark_delete() and revert it).

So we solve this with a two stage approach:

1. We mark the forced obsoletes for removal with auto_fix turned
   on. This will keep the behavior for them the same. If one of
   them can't be removed, we end up reverting it.

   For this, we need to keep the code to create and restore the
   snapshot.

2. We mark the other packages for removal without auto_fix and
   then call ProblemResolver.resolve_by_keep() to fix any broken
   packages by keeping them back.

This brings runtime from multiple seconds down to half a second
for a bare lxd container:

2024-04-29 10:34:35,549 DEBUG Start checking for obsolete pkgs
2024-04-29 10:34:35,912 DEBUG Finish checking for obsolete pkgs

It used to be over 11s before:

2024-04-29 10:28:59,382 DEBUG Start checking for obsolete pkgs
2024-04-29 10:29:11,855 DEBUG Finish checking for obsolete pkgs

LP: #1874272

11047fa... by Julian Andres Klode

Move the actiongroup out of the obsoletes loop

This improves performance as we do not need to check for autoremovable
packages after each removal.

c9d0c4b... by Julian Andres Klode

Fix style issue

9f68fc0... by Julian Andres Klode

Do not write automatically installed bit in simulation

The previous fix was incomplete, while it correctly marked
the packages as automatically installed on the first run,
the simulation ran and then we recalculated the changes.

Since the simulation was writing out the extended_states
for the post-upgrade state, the extended_states files lost
the auto bit for the removed packages, so the next run, when
we recalulcate the changes, didn't see the auto bit anymore,
and packages end up manually installed.

LP: #2064090

7ceab5b... by Julian Andres Klode

Transition the automatically installed bit to t64 libraries

We accidentally marked t64 replacements as manually installed
with the initial version. Fix this by transitioning the automatically
installed bit from the installed library package.

An alternative approach would be to always mark them automatically
installed, but this better preserves user intent.

That being said, we need to quirk this for 24.10 to fix up any
installs that we broke automatic tracking off.

LP: #2064090

cd75996... by Julian Andres Klode

DistUpgrade.cfg.jammy: Add systemd-resolved to PostUpgradeInstall

More and more reports coming in of systemd-resolved failing to install,
but we can't reproduce it, and the logging has gaps - we don't seem to
have Debug::pkgDepCache::Marker on where systemd is being upgraded, so
we don't see why the Recommends is not marked for install.

Adding it to PostUpgradeInstall is the easy way out here.

LP: #2063464

173dd2e... by Nick Rosbrook

DistUpgradeQuirks: keep {netfilter,iptables}-persistent instead of ufw

This replaces commit 7907bea8f6
("DistUpgrade.cfg.jammy: keep {netfilter,iptables}-persistent installed").

Using KeepInstalledPkgs meant that ufw was kept around too, which is not
what we wanted. Just add a new quirk for this: on upgrades from jammy,
if netfilter-persistent and/or iptables-persistent are installed
alongside ufw, keep the former package(s) and remove ufw.

LP: #2061891

b18f3f5... by Nick Rosbrook

Revert "DistUpgrade.cfg.jammy: keep {netfilter,iptables}-persistent installed"

This reverts commit 7907bea8f6cd4dedfbcf7c82c2a6d5aa10caa99e.

2112e9e... by Nick Rosbrook

Release ubuntu-release-upgrader 1:24.04.16

2a32f0e... by Nick Rosbrook

Run pre-build.sh: updating mirrors, demotions, and translations.