Comment 1 for bug 1990856

Revision history for this message
Dan Watkins (oddbloke) wrote :

I've created a reproducer (attached, also at https://pastebin.ubuntu.com/p/H6dTzGBTGp/). This is a small Flask app which wraps archive.ubuntu.com, and modifies the focal main Packages file to include the e2fsprogs and libext2fs2 packages currently in focal-updates (as well as rewriting other metadata as required). It can be run like this (assuming it's written to repro.py):

FLASK_APP=repro.py flask run

Once it's running, the reported debootstrap error can be reproduced by attempting to bootstrap from this "mirror" (without GPG verification: that obviously won't work!):

debootstrap --keep-debootstrap-dir --variant minbase --no-check-gpg focal bootstrap http://127.0.0.1:5000/ubuntu/

You should see this fail with:

W: Failure trying to run: chroot "/root/bootstrap" dpkg --force-overwrite --force-confold --skip-same-version --install

This command should have a package name appended to it. debootstrap has installed the older version of libext2fs2 into the chroot (because it failed to find the newer one), but it has written `/var/lib/dpkg/available` such that `dpkg --predep-package` does detect the newer version and returns "libext2fs2" as a package that needs installing to satisfy Pre-Depends. debootstrap filters out any already-installed packages from that list, and that's why we don't have any package name appended here.

Fixing the determination logic in pkgdetails_field so that debootstrap installs the most recent packages initially fixes this problem: the Pre-Depends on the newer package is satisfied, so `dpkg --predep-package` doesn't return it.