`apk upgrade` sometimes purges packages required by world
(This is on a pinephone running pmOS Edge with the Phosh UI, ie postmarketos-ui-phosh
in world.)
apk-tools-2.12.7-r0
$ sudo apk upgrade -Uasvv
WARNING: Ignoring http://mirror.postmarketos.org/postmarketos/master: No such file or directory
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/edge/main: No such file or directory
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/edge/community: No such file or directory
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/edge/testing: No such file or directory
(1/80) Purging ssl_client (1.34.0-r2)
(2/80) Purging dbus-openrc (1.12.20-r2)
(3/80) Purging modemmanager-openrc (9999_git20210819-r0)
(4/80) Purging cyrus-sasl-openrc (2.1.27-r12)
(5/80) Purging gpsd-openrc (3.23-r0)
(6/80) Purging udev-init-scripts-openrc (35-r0)
(7/80) Purging eudev-openrc (3.2.10-r1)
(8/80) Purging cryptsetup-openrc (2.4.0-r1)
(9/80) Purging device-mapper-udev (2.02.187-r1)
(10/80) Purging kmod-openrc (29-r0)
(11/80) Purging multipath-tools-openrc (0.8.6-r0)
(12/80) Purging waked-openrc (0.1.0-r0)
(13/80) Purging git-perl (2.33.0-r0)
(14/80) Purging perl-git (2.33.0-r0)
(15/80) Purging perl-error (0.17029-r1)
(16/80) Purging postmarketos-tweaks-pinephone (0.7.3-r0)
(17/80) Purging bluez-openrc (5.60-r3)
(18/80) Purging iptables-openrc (1.8.7-r1)
(19/80) Purging networkmanager-openrc (1.32.10-r0)
(20/80) Purging elogind-openrc (246.10-r3)
(21/80) Purging device-pine64-pinephone-upower (0.32-r0)
(22/80) Purging openrc-settingsd-openrc (1.1.0-r0)
(23/80) Purging pulseaudio-bluez (15.0-r0)
(24/80) Purging pulseaudio-openrc (15.0-r0)
(25/80) Purging alsa-utils-openrc (1.2.5.1-r2)
(26/80) Purging libcanberra-pulse (0.30-r6)
(27/80) Purging postmarketos-tweaks-phosh (0.7.3-r0)
(28/80) Purging chrony-openrc (4.1-r0)
(29/80) Purging haveged-openrc (1.9.14-r1)
(30/80) Purging postmarketos-config-nftables-networkmanager (0.6-r0)
(31/80) Purging postmarketos-base-nftables (15-r0)
(32/80) Purging postmarketos-config-nftables (0.6-r0)
(33/80) Purging nftables-openrc (1.0.0-r0)
(34/80) Purging util-linux-misc (2.37.2-r1)
(35/80) Purging runuser (2.37.2-r1)
(36/80) Purging hexdump (2.37.2-r1)
(37/80) Purging uuidgen (2.37.2-r1)
(38/80) Purging blkid (2.37.2-r1)
(39/80) Purging sfdisk (2.37.2-r1)
(40/80) Purging mcookie (2.37.2-r1)
(41/80) Purging wipefs (2.37.2-r1)
(42/80) Purging cfdisk (2.37.2-r1)
(43/80) Purging util-linux-openrc (2.37.2-r1)
(44/80) Purging flock (2.37.2-r1)
(45/80) Purging lsblk (2.37.2-r1)
(46/80) Purging setpriv (2.37.2-r1)
(47/80) Purging logger (2.37.2-r1)
(48/80) Purging partx (2.37.2-r1)
(49/80) Purging findmnt (2.37.2-r1)
(50/80) Purging wpa_supplicant-openrc (2.9-r15)
(51/80) Purging ifupdown-ng-wifi (0.11.3-r0)
(52/80) Purging postmarketos-base-ui-networkmanager (4-r1)
(53/80) Purging sleep-inhibitor-openrc (1.11.1-r0)
(54/80) Purging postmarketos-base-ui-elogind (4-r1)
(55/80) Purging sleep-inhibitor (1.11.1-r0)
(56/80) Purging py3-ruamel.yaml (0.16.12-r1)
(57/80) Purging py3-ruamel.yaml.clib (0.2.2-r2)
(58/80) Purging obex-capabilities-bluez-obexd (0.2.1-r0)
(59/80) Purging postmarketos-base-ui-bluez-obexd (4-r1)
(60/80) Purging obex-capabilities (0.2.1-r0)
(61/80) Purging py3-dbus (1.2.18-r0)
(62/80) Purging postmarketos-base-ui-pulseaudio (4-r1)
(63/80) Purging postmarketos-base-ui-tinydm (4-r1)
(64/80) Purging fuse-openrc (3.10.4-r0)
(65/80) Purging device-pine64-pinephone-phosh (0.32-r0)
(66/80) Purging wys-pinephone (0.1.7-r1)
(67/80) Purging pulseaudio-utils (15.0-r0)
(68/80) Purging meson-vim (0.59.1-r0)
(69/80) Purging nftables-vim (0_git20200629-r0)
(70/80) Purging ifupdown-ng-wireguard (0.11.3-r0)
(71/80) Purging iproute2-tc (5.13.0-r0)
(72/80) Purging ifupdown-ng-iproute2 (0.11.3-r0)
(73/80) Purging iproute2-minimal (5.13.0-r0)
(74/80) Purging iproute2-ss (5.13.0-r0)
(75/80) Purging ip6tables-openrc (1.8.7-r1)
(76/80) Purging polkit-openrc (0.119-r5)
(77/80) Purging libretls (3.3.4-r0)
(78/80) Purging libeconf (0.4.1-r0)
(79/80) Purging libfdisk (2.37.2-r1)
(80/80) Purging libsmartcols (2.37.2-r1)
OK: 1600 MiB in 698 packages
re: the "No such file or directory", strace -fe file
says:
...
faccessat(AT_FDCWD, "/etc/apk/interactive", F_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
openat(3, "etc/apk/arch", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 4
openat(3, "etc/apk/protected_paths.d", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 4
openat(4, "ca-certificates.list", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 5
openat(3, "etc/apk/cache", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 4
openat(3, "etc/apk/keys", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 5
openat(3, "etc/apk/world", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 6
openat(3, "lib/apk/db/installed", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 6
openat(3, "lib/apk/db/triggers", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 6
openat(3, "lib/apk/db/scripts.tar", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 6
openat(3, "etc/passwd", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 7
openat(3, "etc/group", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 7
openat(4, "installed", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(3, "etc/apk/repositories", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 6
openat(4, "APKINDEX.bdd0d494.tar.gz", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
WARNING: Ignoring http://mirror.postmarketos.org/postmarketos/master: No such file or directory
openat(4, "APKINDEX.066df28d.tar.gz", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/edge/main: No such file or directory
openat(4, "APKINDEX.b53994b4.tar.gz", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/edge/community: No such file or directory
openat(4, "APKINDEX.30e6f5af.tar.gz", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/edge/testing: No such file or directory
openat(3, "etc/apk/repositories.d", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(3, "etc/apk/commit_hooks.d", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
(1/80) Purging ssl_client (1.34.0-r2)
...
Those files are indeed missing:
$ ls -la /etc/apk/cache/
total 0
drwxr-xr-x 2 root root 40 Sep 5 13:14 .
drwxr-xr-x 3 root root 60 Sep 4 21:32 ..
However, the device has a working internet connection, and strace -fe network
doesn't show apk upgrade
trying to fetch those files first. Also, purging those 80 packages should not happen anyway, since those packages are required by world:
$ sudo apk del -s ssl_client # (1/80)
WARNING: Ignoring http://mirror.postmarketos.org/postmarketos/master: No such file or directory
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/edge/main: No such file or directory
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/edge/community: No such file or directory
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/edge/testing: No such file or directory
World updated, but the following packages are not removed due to:
ssl_client: alpine-base postmarketos-base postmarketos-ui-phosh device-pine64-pinephone portfolio gnome-sound-recorder
postmarketos-tweaks powersupply firefox-esr vvmplayer gnome-contacts calls chatty gnome-calculator eog gnome-clocks
gnome-passwordsafe otpclient pipewire-alsa wireguard-tools-wg-quick curl gst-plugins-bad megapixels git moreutils
gst-plugins-good gst-plugins-ugly chromium osk-sdl font-noto sxmo-dmenu py3-pydbus grim foot mpv polkit-elogind-libs
polkit-elogind tmux py3-requests py3-serial meson vim gdb
The same is true of the other 79 packages. I'm not sure what's special about these 80 packages out of the ~700 packages I have installed that apk upgrade
wants to purge them.
If I run apk update
before apk upgrade -Uas
, apk update
has no problem fetching the repositories and creating the files in the cache, and then apk upgrade -Uas
also works fine.
I've reproduced this multiple times over the last few days but I'm not sure what the trigger is. I can of course force it to happen with sudo rm /etc/apk/cache/installed /etc/apk/cache/*.tar.gz