[RFC] Make cached remote repositories available on first install
I have bumped into the issue that the APK cache does not exist on the first pmOS installation. Therefore, APK is not able to find packages that are not installed.
shift-axolotl:~$ apk info firefox
WARNING: opening from cache http://mirror.postmarketos.org/postmarketos/master: No such file or directory
WARNING: opening from cache http://dl-cdn.alpinelinux.org/alpine/edge/main: No such file or directory
WARNING: opening from cache http://dl-cdn.alpinelinux.org/alpine/edge/community: No such file or directory
WARNING: opening from cache http://dl-cdn.alpinelinux.org/alpine/edge/testing: No such file or directory
shift-axolotl:~$ apk info firefox-esr
WARNING: opening from cache http://mirror.postmarketos.org/postmarketos/master: No such file or directory
WARNING: opening from cache http://dl-cdn.alpinelinux.org/alpine/edge/main: No such file or directory
WARNING: opening from cache http://dl-cdn.alpinelinux.org/alpine/edge/community: No such file or directory
WARNING: opening from cache http://dl-cdn.alpinelinux.org/alpine/edge/testing: No such file or directory
firefox-esr-102.8.0-r0 description:
Firefox web browser - Extended Support Release
firefox-esr-102.8.0-r0 webpage:
https://www.mozilla.org/en-US/firefox/organizations/
firefox-esr-102.8.0-r0 installed size:
188 MiB
This is fixed by doing an update, where /var/cache/apk
gets populated with the remote indexes. This is an issue for the first experience on GNOME Software and potentially other app stores, since they are unable to fetch information from packages that are not installed. This is probably also inconvenient when using the command line on a new install.
This is an RFC because pmbootstrap seems like the most straightforward place to implement this, but I am not totally sure the most appropriate. That cache can be useful in the scenarios described above, and will get populated anyway, but I am not sure this should be pmbootstrap's responsibility. I could implement the feature that apk-polkit-rs
forces an index download if the APKINDEX cache does not exist, but this has the issue that the daemon starts pretty early, and it's probably possible that the first couple of times the network is not available. So let me know what you think about this :)