Re: Bug#1110696: libglib2.0-0t64: Purging libglib2.0-0:i386 removed gschemas.compiled
Tianyu Chen <[email protected]> Tue, 12 Aug 2025 10:35:34 +0800
| Newsgroups | gmane.linux.debian.devel.dpkg.general |
|---|---|
| Message-ID | <CAG-20GTx-H9eVzNiofP0yfui9PWxgNLeV+LQAe28Yo5U5oNp0A__48036.4466829755$1754967105$gmane$org@mail.gmail.com> |
Simon McVittie <[email protected]> 于2025年8月12日周二 07:06写道: > This is actually not quite enough! To reproduce the bug, you have to > purge libglib2.0-0:amd64 *before* libglib2.0-0:i386, so that the > refcount transition for libglib2.0-0 goes from 1 to 0 while purging > libglib2.0-0:i386. If you had purged those two packages the other way > round, it would have been OK. Actually I don't think I've purged libglib2.0-0:amd64 when testing bookworm->trixie upgrading. But the steps you provided on debian:bookworm-slim are correct. Let me reproduce it again to see the difference later.. Thank you! Tianyu Chen > Reproducer for the bug, which hacks the postrm of libglib2.0-0 to add a > `set -x` so that it's obvious what it is doing: > > $ podman run --rm -it debian:bookworm-slim # or use an expendable chroot > # dpkg --add-architecture i386 > # apt update > # apt install --no-install-recommends \ > libglib2.0-0:i386 libglib2.0-0:amd64 \ > gsettings-desktop-schemas \ > dconf-gsettings-backend dconf-gsettings-backend:i386 \ > dbus-x11 dbus-user-session- > # apt remove --allow-remove-essential $(dpkg-query -W -f '${binary:Package}\n' | grep :i386) > # dpkg --remove-architecture i386 > # sed -i -e 's/^set -e$/&x/' /var/lib/dpkg/info/libglib2.0-0\:*.postrm > # sed -i -e 's/bookworm/trixie/g' /etc/apt/sources.list.d/debian.sources > # apt update > # apt dist-upgrade > … > Preparing to unpack .../libglib2.0-0t64_2.84.3-1_amd64.deb ... > libglib2.0-0t64.preinst: Removing /var/lib/dpkg/info/libglib2.0-0:amd64.postrm to avoid loss of /usr/share/glib-2.0/sc > hemas/gschemas.compiled... > removed '/var/lib/dpkg/info/libglib2.0-0:amd64.postrm' > … > # test -e /usr/share/glib-2.0/schemas/gschemas.compiled && echo ok > ok > # dpkg --purge libglib2.0-0:amd64 > (Reading database ... 6472 files and directories currently installed.) > # dpkg --purge libglib2.0-0:i386 > (Reading database ... 6472 files and directories currently installed.) > Purging configuration files for libglib2.0-0:i386 (2.74.6-2+deb12u6) ... > + [ -d /usr/lib/i386-linux-gnu/gio/modules ] > + [ purge = purge ] > + [ -d /usr/share/glib-2.0/schemas ] > + [ 1 = 1 ] > + rm -f /usr/share/glib-2.0/schemas/gschemas.compiled > + rmdir -p --ignore-fail-on-non-empty /usr/share/glib-2.0/schemas > # test -e /usr/share/glib-2.0/schemas/gschemas.compiled && echo still ok > (no output!) > > Here, gsettings-desktop-schemas is a convenient example of a package that > contains a GSettings schema (which GLib summarizes into > an architecture-independent gschemas.compiled via a dpkg trigger). > Similarly dconf-gsettings-backend is a convenient example of a package > that contains GIO modules (which GLib summarizes into a module list per > architecture). dbus-x11 and dbus-user-session- just avoid wasting time > installing and upgrading systemd in a container with no init system. > > With an updated libglib2.0-0t64.preinst that disarms libglib2.0-0.postrm > on a more complete set of architectures, the bug no longer appears. > > On Sun, 10 Aug 2025 at 10:50:40 +0100, Simon McVittie wrote: > >dpkg team: is there a good way to ask dpkg for a full list of > >architectures that might conceivably have a package installed? > > > >I suppose there's > > > > dpkg-query -W -f '${Architecture}\n' | sort -u | grep -v '^all$' > > > >but, ugh. > > Of course the command I wasn't thinking of at the time is: > > $(dpkg-query -W -f '${Architecture}\n' libglib2.0-0 > > which lists the architectures of any versions of libglib2.0-0 that might > still be present and in particular might still have a postrm, including > removed-but-not-purged status. > > smcv