UX/UI: apk should perhaps give some clues or find out on its own how to remove a temporarily installed testing package, when it causes lingering dependencies
First of all, I realize the following is meant to cause problems that the average users can't solve, and is a command you're not meant to run. It's therefore a self-inflicted problem on my behalf, for sure.
With that out of the way, I still feel like apk could handle this scenario better with at least some hints on how to proceed, when 1. installing a testing package via apk add ... --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing
that pulls in further testing packages, 2. then simply uninstalling that package again right away:
-
This is what I did to install, fairly straightforward:
# apk add libguestfs --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ The following NEW packages will be installed: libburn libguestfs libisoburn libisofs xorriso xwaylandvideobridge Need to download 1108 KiB of packages. After this operation, 2836 KiB of additional disk space will be used. Do you want to continue [Y/n]? y (1/6) Installing libburn (1.5.6-r0) (2/6) Installing libisofs (1.5.6-r0) (3/6) Installing libisoburn (1.5.6-r0) (4/6) Installing xorriso (1.5.6-r0) (5/6) Installing libguestfs (1.52.0-r1) (6/6) Installing xwaylandvideobridge (0.4.0-r1) Executing busybox-1.37.0-r8.trigger Executing gtk-update-icon-cache-3.24.43-r2.trigger Executing desktop-file-utils-0.28-r0.trigger OK: 9389 MiB in 1952 packages # apk add libguestfs-dev --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ The following NEW packages will be installed: libguestfs-dev Need to download 29 KiB of packages. After this operation, 236 KiB of additional disk space will be used. Do you want to continue [Y/n]? y (1/1) Installing libguestfs-dev (1.52.0-r1) OK: 9389 MiB in 1953 packages #
-
Then the uninstall attempt:
# apk del libguestfs libguestfs-dev libburn libisofs xorriso libguestfs xwaylandvideobridge --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ World updated, but the following packages are not removed due to: xwaylandvideobridge: postmarketos-ui-plasma-desktop alpine-base postmarketos-base postmarketos-base-ui postmarketos-base-ui-plasma postmarketos-base-ui-networkmanager-usb-tethering postmarketos-base-ui-networkmanager postmarketos-base-ui-flatpak flatpak postmarketos-base-ui-bluez-openrc bluez-openrc ...lots of other stuff listed here... py3-jinja2 py3-lxml py3-pillow gdb device-generic-x86_64 postmarketos-base-ui-wifi-wpa_supplicant The following packages will be REMOVED: libburn libguestfs libguestfs-dev libisoburn libisofs xorriso After this operation, 2880 KiB of disk space will be freed. Do you want to continue [Y/n]? y (1/6) Purging libguestfs-dev (1.52.0-r1) (2/6) Purging libguestfs (1.52.0-r1) (3/6) Purging xorriso (1.5.6-r0) (4/6) Purging libisoburn (1.5.6-r0) (5/6) Purging libburn (1.5.6-r0) (6/6) Purging libisofs (1.5.6-r0) Executing busybox-1.37.0-r8.trigger OK: 9386 MiB in 1947 packages #
My best guess for what happened is: inside the testing repository, one of the other listed non-testing packages has a dependency on xwaylandvideobridge
which is only in the testing repository. When doing apk add xwaylandvideobridge --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing
, apk seems to somehow also save that these non-testing packages will in the future depend on it (even though they weren't upgraded to the testing versions). Then when trying to remove xwaylandvideobridge
again, apk perhaps doesn't have the necessarily solver trick to realize that when all the other packages that depend on it in the future are old enough in the present version, those dependencies can be safely ignored.
Whatever the case is, it would be nice if the solver for apk del
somehow was familiar with this scenario of an upgraded package version having additional new dependencies, and e.g. offered to downgrade the other dependencies again (which isn't even needed here, i think) if that's needed to uninstall something, rather than not doing it.