apk-tools issueshttps://gitlab.alpinelinux.org/alpine/apk-tools/-/issues2021-10-14T08:39:10Zhttps://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10772show summary of changes before "apk add"2021-10-14T08:39:10ZDocbrokeshow summary of changes before "apk add"Running apk add starts making changes, which are sometime unexpected.
For example, I was looking at nota
```
[ins]$ apk info -a nota
nota-2.0.0-r1 description:
Nota is a simple and convergent text editor
nota-2.0.0-r1 webpage:
https://i...Running apk add starts making changes, which are sometime unexpected.
For example, I was looking at nota
```
[ins]$ apk info -a nota
nota-2.0.0-r1 description:
Nota is a simple and convergent text editor
nota-2.0.0-r1 webpage:
https://invent.kde.org/maui/nota
nota-2.0.0-r1 installed size:
268 KiB
nota-2.0.0-r1 depends on:
mauikit-texteditor
so:libKF5CoreAddons.so.5
so:libKF5I18n.so.5
so:libMauiKit.so
so:libMauiKitFileBrowsing.so.1
so:libQt5Core.so.5
so:libQt5Gui.so.5
so:libQt5Qml.so.5
so:libQt5Widgets.so.5
so:libc.musl-x86_64.so.1
so:libstdc++.so.6
nota-2.0.0-r1 provides:
cmd:nota
nota-2.0.0-r1 has auto-install rule:
nota-2.0.0-r1 license:
GPL-2.0-or-later
```
Only 268 KiB and few libs, So I decided to try.
```
[ins]$ doas apk add nota
(1/102) Purging gnome-keyring-lang (40.0-r0)
(2/102) Purging gnome-keyring-doc (40.0-r0)
(3/102) Purging gnome-keyring (40.0-r0)
(4/102) Installing kconfig (5.87.0-r0)
(5/102) Installing kconfig-doc (5.87.0-r0)
0%
```
It begin with removing gnome-keyring, and started to install 102 packages.https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10771pkgusers/pkggroups + install -o/-g doesn't stick in /var2023-12-12T22:22:03ZDrew DeVaultpkgusers/pkggroups + install -o/-g doesn't stick in /varhttps://git.sr.ht/~sircmpwn/sr.ht-apkbuilds/tree/master/item/sr.ht/sr.ht-uacme/APKBUILD#L43
This does not seem to work; I have to add a post-install to force the desired user/group. The tarball looks right, though, may be an apk-tools i...https://git.sr.ht/~sircmpwn/sr.ht-apkbuilds/tree/master/item/sr.ht/sr.ht-uacme/APKBUILD#L43
This does not seem to work; I have to add a post-install to force the desired user/group. The tarball looks right, though, may be an apk-tools issue?v3.1https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10770[Question] From where does apk info source information?2022-12-21T20:20:23ZRyan Parman[Question] From where does apk info source information?Using Alpine support in Artifactory to store internal packages. Trying to track down the source of a bug.
There is one copy of a package stored in Artifactory, but after `apk update`, running `apk info {package}` shows the same package ...Using Alpine support in Artifactory to store internal packages. Trying to track down the source of a bug.
There is one copy of a package stored in Artifactory, but after `apk update`, running `apk info {package}` shows the same package data twice. (This package does not existing in the official, upstream repos provided by the Alpine team.)
When running `apk add {package}`, it won't install because `apk` thinks that it conflicts with… itself.
Before I go back to JFrog and ask for a fix that will take them a year to release, I'd like to understand how `apk` sources its data for `apk info` and `apk add` to figure out if it's my bug, their bug, or an `apk` bug. I've looked through the Alpine wiki and searched the web, but haven't been able to find anything meaningful.
Thanks!https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10769[RFC] rename apk to avoid confusion with Android package format2022-12-21T19:39:44ZPaul Spooren[RFC] rename apk to avoid confusion with Android package formatWhenever looking up issues or code around the `apk` package manage I'll likely find results describing corner cases of the Android package format `.apk`.
I'm wondering if a *better* name could be found in some future. Clearly this is no...Whenever looking up issues or code around the `apk` package manage I'll likely find results describing corner cases of the Android package format `.apk`.
I'm wondering if a *better* name could be found in some future. Clearly this is not a pushing issues but I'm a bit concerned that once `apk` is used for *OpenWrt*, a flood of obscure error messages and confused user appear.backloghttps://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10768"apk" give "Illegal instruction" in x86 edge on vortex86 device.2021-09-16T09:21:56ZThorbjørn Ravn Andersen"apk" give "Illegal instruction" in x86 edge on vortex86 device.We need to deploy Alpine Linux on vortex86 devices and since I used edge the last time about a month ago something has happened. I did a v3.14 install to the harddrive, and pointed the repositories to edge and did an `apk upgrade`. Now ...We need to deploy Alpine Linux on vortex86 devices and since I used edge the last time about a month ago something has happened. I did a v3.14 install to the harddrive, and pointed the repositories to edge and did an `apk upgrade`. Now this happens.
```
device-001beb6a7a42:~# gdb /sbin/apk
GNU gdb (GDB) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "i586-alpine-linux-musl".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /sbin/apk...
(No debugging symbols found in /sbin/apk)
(gdb) run
Starting program: /sbin/apk
Program received signal SIGILL, Illegal instruction.
0xb7d312d0 in ?? () from /lib/libcrypto.so.3
(gdb)
```
Also
```
device-001beb6a7a42:~# cat /proc/cpuinfo
processor : 0
vendor_id : Vortex86 SoC
cpu family : 5
model : 2
model name : 05/02
stepping : 2
cpu MHz : 800.031
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fdiv_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu tsc cx8 cpuid
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 1600.73
clflush size : 32
cache_alignment : 32
address sizes : 32 bits physical, 32 bits virtual
power management:
```
Please advisehttps://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10767apk: HTTPS broken after system update2021-11-10T15:25:45ZMogens Jensenapk: HTTPS broken after system updateAfter updating an Alpine edge x86_64 system, apk no longer works with HTTPS:
```
$ sudo apk update -v
fetch https://ftp.acc.umu.se/mirror/alpinelinux.org/edge/main/x86_64/APKINDEX.tar.gz
480BD0E0A57F0000:error:0A000086:SSL routines:tls_...After updating an Alpine edge x86_64 system, apk no longer works with HTTPS:
```
$ sudo apk update -v
fetch https://ftp.acc.umu.se/mirror/alpinelinux.org/edge/main/x86_64/APKINDEX.tar.gz
480BD0E0A57F0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1882:
ERROR: https://ftp.acc.umu.se/mirror/alpinelinux.org/edge/main: Permission denied
WARNING: Ignoring https://ftp.acc.umu.se/mirror/alpinelinux.org/edge/main: No such file or directory
```
For some reason `ca-certificates` was removed during the system update, so changing the mirror to HTTP and reinstalling it fixes the problem.
Should `apk-tools` depend on `ca-certificates` to avoid this problem in the future?https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10766proposal: add logging feature to apk command2022-12-21T19:29:14ZHGpunktTproposal: add logging feature to apk commandSome 8 years ago there has been a discussion concerning logging from apk command
[](https://lists.alpinelinux.org/~alpine/devel/patches/468)
but there is still no option for apk to cause logging the (de)installation of packages.
The comm...Some 8 years ago there has been a discussion concerning logging from apk command
[](https://lists.alpinelinux.org/~alpine/devel/patches/468)
but there is still no option for apk to cause logging the (de)installation of packages.
The commands
`apk add pkgname 2>&1 | while IFS= read -r line
do printf '%s %s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$line"; done | tee -a /var/log/apk`
keep record of package installation, but I would appreciate very much to have such a feature integrated in the apk command.https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10765Add support for variables in /etc/apk/repositories like Yum has2022-12-21T19:39:44ZChristoph ObexerAdd support for variables in /etc/apk/repositories like Yum hasThis would IMO solve #10756 by replacing the repo in /etc/apk/repositories by a caching proxy
An example need of such a feature is documented in the wiki:
https://wiki.alpinelinux.org/wiki/Alpine_newbie_apk_packages#New_users:_installin...This would IMO solve #10756 by replacing the repo in /etc/apk/repositories by a caching proxy
An example need of such a feature is documented in the wiki:
https://wiki.alpinelinux.org/wiki/Alpine_newbie_apk_packages#New_users:_installing_needed_packages
```
# old /etc/apk/repositories from the example above
cat > /etc/apk/repositories << EOF; $(echo)
http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/main
EOF
```
would become:
```
# proposed /etc/apk/repositories
cat > /etc/apk/repositories << EOF; $(echo)
http://dl-cdn.alpinelinux.org/alpine/v\$releasever/main
EOF
```
Now that is of little use, BUT we use Artifactory as cache and thus point our Alpine containers to a repo mirror there... but need a separate repo file for every alpine release or synthesize a repo file based on the alpine release... that sounds easy enough but the code that needs to synthesize the repo file needs to be running outside the container and thus has to guess the correct release number from docker tags for various base images (node, go, java, ...)...
We would love to be able to just bind mount `/etc/apk/repositories` with our artifactory repositories (and credentials) without fancy magic and use `$releasever` as a placeholder for the version inside them.backloghttps://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10764`apk upgrade` sometimes purges packages required by world2022-12-28T12:59:45ZArnav Singh`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
```sh
$ sudo apk upgrade -Uasvv
WARNING: Ignoring http://mirror.postmarketos.org/postmarketos/master: No such file ...(This is on a pinephone running pmOS Edge with the Phosh UI, ie `postmarketos-ui-phosh` in world.)
apk-tools-2.12.7-r0
```sh
$ 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:
```sh
$ 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:
```sh
$ 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`https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10763Build breakage in OpenWrt build system2021-08-25T19:11:52ZPaul SpoorenBuild breakage in OpenWrt build systemHi, since OpenWrt wants to change over to APK I've ported it to the build system, which automatically packs copiled packages into packages. The latest APK version doesn't compile crashing with the following message, any ideas?
```
Apply...Hi, since OpenWrt wants to change over to APK I've ported it to the build system, which automatically packs copiled packages into packages. The latest APK version doesn't compile crashing with the following message, any ideas?
```
Applying ./patches/0001-remove-doc-generation.patch using plaintext:
patching file Makefile
Applying ./patches/0002-limits.h.patch using plaintext:
patching file src/tar.c
touch /home/user/src/openwrt/openwrt/build_dir/hostpkg/apk-tools-74361938857d62149a93e992fb8edccc5a322b4a/.preparedfcec5eb5429e8ed8f43a05d61213ed27_6664517399ebbbc92a37c5bb081b5c53
(cd /home/user/src/openwrt/openwrt/build_dir/hostpkg/apk-tools-74361938857d62149a93e992fb8edccc5a322b4a/; if [ -x configure ]; then cp -fpR /home/user/src/openwrt/openwrt/scripts/config.{guess,sub} /home/user/src/openwrt/openwrt/build_dir/hostpkg/apk-tools-74361938857d62149a93e992fb8edccc5a322b4a// && CC="ccache gcc" CFLAGS="-O2 -I/home/user/src/openwrt/openwrt/staging_dir/host/include -I/home/user/src/openwrt/openwrt/staging_dir/hostpkg/include -I/home/user/src/openwrt/openwrt/staging_dir/target-aarch64_cortex-a72_musl/host/include -I/home/user/src/openwrt/openwrt/staging_dir/hostpkg/lib/" CXX="ccache g++" CPPFLAGS="-I/home/user/src/openwrt/openwrt/staging_dir/host/include -I/home/user/src/openwrt/openwrt/staging_dir/hostpkg/include -I/home/user/src/openwrt/openwrt/staging_dir/target-aarch64_cortex-a72_musl/host/include" LDFLAGS="-L/home/user/src/openwrt/openwrt/staging_dir/host/lib -L/home/user/src/openwrt/openwrt/staging_dir/hostpkg/lib -L/home/user/src/openwrt/openwrt/staging_dir/target-aarch64_cortex-a72_musl/host/lib -pthread" CONFIG_SHELL="/usr/bin/env bash" bash ./configure --target=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --program-prefix="" --program-suffix="" --prefix=/home/user/src/openwrt/openwrt/staging_dir/hostpkg --exec-prefix=/home/user/src/openwrt/openwrt/staging_dir/hostpkg --sysconfdir=/home/user/src/openwrt/openwrt/staging_dir/hostpkg/etc --localstatedir=/home/user/src/openwrt/openwrt/staging_dir/hostpkg/var --sbindir=/home/user/src/openwrt/openwrt/staging_dir/hostpkg/bin ; fi )
touch /home/user/src/openwrt/openwrt/build_dir/hostpkg/apk-tools-74361938857d62149a93e992fb8edccc5a322b4a/.configured
CFLAGS="-O2 -I/home/user/src/openwrt/openwrt/staging_dir/host/include -I/home/user/src/openwrt/openwrt/staging_dir/hostpkg/include -I/home/user/src/openwrt/openwrt/staging_dir/target-aarch64_cortex-a72_musl/host/include -I/home/user/src/openwrt/openwrt/staging_dir/hostpkg/lib/" CPPFLAGS="-I/home/user/src/openwrt/openwrt/staging_dir/host/include -I/home/user/src/openwrt/openwrt/staging_dir/hostpkg/include -I/home/user/src/openwrt/openwrt/staging_dir/target-aarch64_cortex-a72_musl/host/include" CXXFLAGS="" LDFLAGS="-L/home/user/src/openwrt/openwrt/staging_dir/host/lib -L/home/user/src/openwrt/openwrt/staging_dir/hostpkg/lib -L/home/user/src/openwrt/openwrt/staging_dir/target-aarch64_cortex-a72_musl/host/lib -pthread" make -j1 -C /home/user/src/openwrt/openwrt/build_dir/hostpkg/apk-tools-74361938857d62149a93e992fb8edccc5a322b4a DESTDIR=/home/user/src/openwrt/openwrt/staging_dir/hostpkg LUA=no
make[3]: Entering directory '/home/user/src/openwrt/openwrt/build_dir/hostpkg/apk-tools-74361938857d62149a93e992fb8edccc5a322b4a'
GENERR libfetch/ftperr.h
GENERR libfetch/httperr.h
CC libfetch/common.o
CC libfetch/fetch.o
CC libfetch/file.o
CC libfetch/ftp.o
CC libfetch/http.o
CC libfetch/openssl-compat.o
AR libfetch/libfetch.a
SED src/apk.pc
GENHELP src/help.h
ln -sf libapk.so.2.99.0 src/libapk.so
CC src/adb.o
CC src/adb_comp.o
CC src/adb_walk_adb.o
CC src/adb_walk_genadb.o
CC src/adb_walk_gentext.o
CC src/adb_walk_text.o
CC src/apk_adb.o
CC src/atom.o
CC src/blob.o
CC src/commit.o
CC src/common.o
CC src/context.o
CC src/crypto_openssl.o
CC src/database.o
CC src/extract.o
CC src/extract_v2.o
CC src/extract_v3.o
CC src/hash.o
CC src/io.o
CC src/io_gunzip.o
CC src/io_url.o
CC src/package.o
CC src/pathbuilder.o
CC src/print.o
CC src/solver.o
CC src/tar.o
CC src/trust.o
CC src/version.o
AR src/libapk.a
LD -shared src/libapk.so.2.99.0
CC src/apk.o
CC src/app_adbdump.o
CC src/app_adbsign.o
CC src/app_add.o
CC src/app_audit.o
CC src/app_cache.o
CC src/app_convdb.o
CC src/app_convndx.o
CC src/app_del.o
CC src/app_dot.o
CC src/app_extract.o
CC src/app_fetch.o
CC src/app_fix.o
CC src/app_index.o
CC src/app_info.o
CC src/app_list.o
CC src/app_manifest.o
CC src/app_mkndx.o
CC src/app_mkpkg.o
CC src/app_policy.o
CC src/app_search.o
CC src/app_stats.o
CC src/app_update.o
CC src/app_upgrade.o
CC src/app_verify.o
CC src/app_version.o
CC src/app_vertest.o
CC src/applet.o
LD src/apk
/usr/bin/ld: /home/user/src/openwrt/openwrt/staging_dir/hostpkg/lib/libapk.so: warning: EVP_CipherFinal is often misused, please use EVP_CipherFinal_ex and EVP_CIPHER_CTX_cleanup
/usr/bin/ld: /home/user/src/openwrt/openwrt/staging_dir/hostpkg/lib/libapk.so: warning: EVP_DecryptFinal is often misused, please use EVP_DecryptFinal_ex and EVP_CIPHER_CTX_cleanup
/usr/bin/ld: /home/user/src/openwrt/openwrt/staging_dir/hostpkg/lib/libapk.so: warning: EVP_EncryptFinal is often misused, please use EVP_EncryptFinal_ex and EVP_CIPHER_CTX_cleanup
/usr/bin/ld: src/app_convndx.o: in function `conv_main':
app_convndx.c:(.text+0x38b): undefined reference to `apk_extract'
/usr/bin/ld: src/app_extract.o: in function `extract_file':
app_extract.c:(.text+0x320): undefined reference to `apk_extract_file'
/usr/bin/ld: src/app_extract.o: in function `extract_main':
app_extract.c:(.text+0x638): undefined reference to `apk_extract'
/usr/bin/ld: src/app_extract.o:(.data.rel.ro+0x8): undefined reference to `apk_extract_v2_meta'
/usr/bin/ld: src/app_manifest.o: in function `process_match':
app_manifest.c:(.text+0x63f): undefined reference to `apk_extract'
/usr/bin/ld: src/app_manifest.o:(.data.rel.ro+0x8): undefined reference to `apk_extract_v2_meta'
/usr/bin/ld: src/app_mkndx.o: in function `mkndx_read_v2_pkginfo':
app_mkndx.c:(.text+0x36a): undefined reference to `apk_extract_v2_control'
/usr/bin/ld: src/app_mkndx.o: in function `mkndx_main':
app_mkndx.c:(.text+0x9ed): undefined reference to `apk_extract'
/usr/bin/ld: src/app_verify.o: in function `verify_main':
app_verify.c:(.text+0xb8): undefined reference to `apk_extract'
collect2: error: ld returned 1 exit status
make[4]: *** [Make.rules:276: src/apk] Error 1
make[3]: *** [Make.rules:337: src/] Error 2
make[3]: Leaving directory '/home/user/src/openwrt/openwrt/build_dir/hostpkg/apk-tools-74361938857d62149a93e992fb8edccc5a322b4a'
make[2]: *** [Makefile:58: /home/user/src/openwrt/openwrt/build_dir/hostpkg/apk-tools-74361938857d62149a93e992fb8edccc5a322b4a/.built] Error 2
make[2]: Leaving directory '/home/user/src/openwrt/openwrt/package/utils/apk'
time: package/utils/apk/host-compile#16.60#1.67#18.24
ERROR: package/utils/apk [host] failed to build.
make[1]: *** [package/Makefile:116: package/utils/apk/host/compile] Error 1
make[1]: Leaving directory '/home/user/src/openwrt/openwrt'
make: *** [/home/user/src/openwrt/openwrt/include/toplevel.mk:230: package/apk/host/compile] Error 2
```https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10762apk-tools scripts db preventing reproducible docker builds2023-02-23T09:35:23Znvaatstraapk-tools scripts db preventing reproducible docker buildsWhen you pull an Alpine Docker image and add a package, the `/lib/apk/db/scripts.tar` archive is updated with timing based on the current timestamp. Building multiple images using the same Dockerfile hence generates images which are not ...When you pull an Alpine Docker image and add a package, the `/lib/apk/db/scripts.tar` archive is updated with timing based on the current timestamp. Building multiple images using the same Dockerfile hence generates images which are not identical.
Similar to MR apk-tools!63 (io_archive: Use SOURCE_DATE_EPOCH for meta files instead of current time) it would be great to have this timestamp based on SOURCE_DATE_EPOCH.
Suggestion: Perhaps change this behaviour by using the `apk_get_build_time()` introduced based on the above mentioned MR in [src/database.c](src/database.c#L1012) instead of `time_t now = time(NULL)`?https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10761Proposal: Make apk-fetch respect --arch too2024-03-25T11:49:10ZSören TempelProposal: Make apk-fetch respect --arch tooThe `--arch` flag is a global option to `apk(8)`. Unfortunately, it only seems to be respected presently when used in conjunction with `--root`. For this reason, `apk fetch --arch riscv64 linux-edge` will download the `linux-edge` packag...The `--arch` flag is a global option to `apk(8)`. Unfortunately, it only seems to be respected presently when used in conjunction with `--root`. For this reason, `apk fetch --arch riscv64 linux-edge` will download the `linux-edge` package for the host architecture (e.g. `x86_64`, not for `riscv64`). Unfortunately, it also does not emit an error message which is very confusing.
I would propose the following changes:
1. Make `apk-fetch(8)` respect `--arch`, e.g. `apk fetch --arch riscv64 linux-edge` should download the `linux-edge` package for the `riscv64` architecture.
2. Make `apk` subcommands which do not support `--arch` fail. This was a source of confusion in the past, see for example https://gitlab.alpinelinux.org/alpine/aports/-/issues/12905v3.1https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10760Parallelize triggers2024-01-10T16:03:46ZAriadne Conillariadne@ariadne.spaceParallelize triggersSome triggers can take multiple seconds (up to minutes) to run, like the `mkinitfs` trigger.
It would be a nice win to run all triggers in parallel.
Another thing to consider might be running triggers in the background.Some triggers can take multiple seconds (up to minutes) to run, like the `mkinitfs` trigger.
It would be a nice win to run all triggers in parallel.
Another thing to consider might be running triggers in the background.v3.1https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10759Typo in apk list --upgradable makes long option fail2021-08-23T08:08:45ZSaribroTypo in apk list --upgradable makes long option failIn apk-tools 2.12.7:
apk list --help shows the long-form option "--upgradable" ( https://git.alpinelinux.org/apk-tools/tree/doc/apk-list.8.scd line 30), however, the code scans for "--upgradeable" ( https://git.alpinelinux.org/apk-tools...In apk-tools 2.12.7:
apk list --help shows the long-form option "--upgradable" ( https://git.alpinelinux.org/apk-tools/tree/doc/apk-list.8.scd line 30), however, the code scans for "--upgradeable" ( https://git.alpinelinux.org/apk-tools/tree/src/app_list.c line 182).
"--upgradable" fails, and prints the help,\
"--upgradeable" works.https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10758Ignored / phantom packages2022-12-21T19:37:22ZAlan DiwixIgnored / phantom packagesIs there any way to replace a package with "phantom" version of it that neither replaces nor introduces any files, but satisfies the same dependencies as original?
For example xbps' ignorepkg:
https://man.voidlinux.org/xbps.d.5
If not, ...Is there any way to replace a package with "phantom" version of it that neither replaces nor introduces any files, but satisfies the same dependencies as original?
For example xbps' ignorepkg:
https://man.voidlinux.org/xbps.d.5
If not, I guess this would be a feature request.v3.1https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10756Document proxy support better2022-12-21T19:39:45ZHadmut DanischDocument proxy support betterThis is rather a documentation than a software issue, but the wiki didn't let me write to the discussion page of the apk management.
When creating virtual images (especially with docker) with alpine (what it is just perfect for), it ta...This is rather a documentation than a software issue, but the wiki didn't let me write to the discussion page of the apk management.
When creating virtual images (especially with docker) with alpine (what it is just perfect for), it takes typically lots of iterations to recreate the image and have lots of apk packages installed from scratch. Since every installation run typically starts with a fresh, clean system without a persistent cache dir, there is no point in using the local cache feature of apk.
Fetching the images again with every run is time consuming, creates network traffic (possibly expensive), and puts load on alpine's servers. So there's good reason to try to have some local mirror/cache. Unfortunately I didn't find any hint in the docs on what's the recommended way. They are just mentioning apk's local cache function.
Other package managers like apt, yum, gem allow to configure external caches/proxies.
My guess (not yet tested) would be hat apk should honor a https_proxy environment variable pointing to an external, HTTPS-intercepting cache after installing it's certificate to /etc/ssl/certs, but I didn't try this yet.
It would therefore be good to have a section in the documentation about how to use apk with some external cache mechanism.backloghttps://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10755replaced files are not restored when uninstalling replacing package2022-12-21T20:28:45ZAlex Xu (Hello71)replaced files are not restored when uninstalling replacing packageexample: install libc6-compat, then install gcompat, then remove gcompat. expected behavior is libc6-compat files are restored, but this doesn't happenexample: install libc6-compat, then install gcompat, then remove gcompat. expected behavior is libc6-compat files are restored, but this doesn't happenv3.1https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10754apk should prune obsolete indices2023-04-10T20:13:17ZAriadne Conillariadne@ariadne.spaceapk should prune obsolete indicesOn my machine:
```
treefort:~$ ls -al /var/cache/apk/APKINDEX.*
-rw-r--r-- 1 root root 656814 Sep 22 2020 /var/cache/apk/APKINDEX.066df28d.tar.gz
-rw-r--r-- 1 root root 634253 Sep 6 2020 /var/cache/apk/APK...On my machine:
```
treefort:~$ ls -al /var/cache/apk/APKINDEX.*
-rw-r--r-- 1 root root 656814 Sep 22 2020 /var/cache/apk/APKINDEX.066df28d.tar.gz
-rw-r--r-- 1 root root 634253 Sep 6 2020 /var/cache/apk/APKINDEX.2c4ac24e.tar.gz
-rw-r--r-- 1 root root 633808 Sep 22 2020 /var/cache/apk/APKINDEX.30e6f5af.tar.gz
-rw-r--r-- 1 root root 1145983 Sep 6 2020 /var/cache/apk/APKINDEX.40a3604f.tar.gz
-rw-r--r-- 1 root root 1566651 Jun 25 13:03 /var/cache/apk/APKINDEX.74fbe57d.tar.gz
-rw-r--r-- 1 root root 642689 Jun 25 13:03 /var/cache/apk/APKINDEX.924f3f67.tar.gz
-rw-r--r-- 1 root root 1226681 Sep 22 2020 /var/cache/apk/APKINDEX.b53994b4.tar.gz
-rw-r--r-- 1 root root 638355 Jun 25 13:03 /var/cache/apk/APKINDEX.e3b89664.tar.gz
```
@mps has also noticed similar. We should garbage collect these obsolete indices.v3.0https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10753Incorrect architecture name prevents gcompat from working2021-07-27T05:26:57ZDull BananasIncorrect architecture name prevents gcompat from workinghttps://git.adelielinux.org/adelie/gcompat/-/issues/343https://git.adelielinux.org/adelie/gcompat/-/issues/343https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10750apk is perceivably slower in an LXC container than in the "global zone" on th...2022-12-21T20:02:35ZGábor ADORJÁNIapk is perceivably slower in an LXC container than in the "global zone" on the same machineHello,
I know this report is quite vague, but the issue is pretty annoying and I'm not sure where to look for further clues. I searched in Gitlab, but could not find any relevant issues.
I run a small home server on a PC Engines APU2C4...Hello,
I know this report is quite vague, but the issue is pretty annoying and I'm not sure where to look for further clues. I searched in Gitlab, but could not find any relevant issues.
I run a small home server on a PC Engines APU2C4 box. The global zone is Alpine x86_64 3.14, and there's also an LXC container with the same OS. The server runs some other workloads, but it's not really heavily loaded.
Both Alpine deployments use the same remote package repository (dl-4) and the same HTTP proxy. There's only one restriction on the LXC container: the memory is capped at 128 MB, otherwise it can use all the available 4 CPU cores (just like the global zone). But there's plenty of free memory, so it should not be a limiting factor.
The GZ uses Ext4, but the container is on ZFS (same mSATA SSD, different partitions). Watching apk with `strace` revealed it does some heavy lifting in `/lib/apk/db`, so to give an edge to the LXC container, I moved it temporarily to ramdisk. It did not help.
After having installed `ltrace`, I measured the library calls, so here are some numbers below. I executed `ltrace -t apk install ltrace` a couple of times on each OS instances, which stresses the package manager, but does not change the system.
Snippet from the output in the global zone:
```
23:42:51 getopt_long(3, 0x7fff1f9630d8, "fhiqX:p:UvVslut:", 0x7fff1f9624b8, nil) = -1
23:42:51 strcmp("add", "add") = 0
23:42:51 apk_db_init(0x5633f983b900, 0x5633f983653a, 0, 4) = 0x7fac08a12790
23:42:52 signal(SIGINT, 0x5633f982ef29) = 0
23:42:52 apk_db_open(0x5633f983b900, 0x7fff1f963010, 0, 0) = 0
23:42:54 apk_array_resize(0x7fac08a12790, 1, 8, 179) = 0x7fac074ed200
23:42:54 apk_array_resize(0, 108, 24, 0) = 0x7fac074a2ab0
23:42:54 getuid() = 0
```
The LXC container, when `/lib/apk/db` is on ZFS (compression=lz4, atime=off):
```
23:42:49 getopt_long(3, 0x7fff74767118, "fhiqX:p:UvVslut:", 0x7fff747664f8, nil) = -1
23:42:49 strcmp("add", "add") = 0
23:42:49 apk_db_init(0x555f33c82900, 0x555f33c7d53a, 0, 4) = 0x7fedae2ce790
23:42:49 signal(SIGINT, 0x555f33c75f29) = 0
23:42:49 apk_db_open(0x555f33c82900, 0x7fff74767050, 0, 0) = 0
23:42:55 apk_array_resize(0x7fedae2ce790, 1, 8, 179) = 0x7fedac65cdd0
23:42:55 apk_array_resize(0, 72, 24, 0) = 0x7fedac798f10
23:42:55 getuid() = 0
```
The LXC container, now `/lib/apk/db` was tmpfs (original files copied over):
```
23:49:50 getopt_long(3, 0x7ffd23e96b48, "fhiqX:p:UvVslut:", 0x7ffd23e95f28, nil) = -1
23:49:50 strcmp("add", "add") = 0
23:49:50 apk_db_init(0x559689884900, 0x55968987f53a, 0, 4) = 0x7f066576e790
23:49:50 signal(SIGINT, 0x559689877f29) = 0
23:49:50 apk_db_open(0x559689884900, 0x7ffd23e96a80, 0, 0) = 0
23:49:55 apk_array_resize(0x7f066576e790, 1, 8, 179) = 0x7f0663afcdd0
23:49:55 apk_array_resize(0, 72, 24, 0) = 0x7f0663c38f10
23:49:55 getuid() = 0
```
As you can see, `apk_db_open()` suffers a massive, 5-6s delay, compared to the instance running in the global zone.
TBH the container has more packages installed, the `/lib/apk/db/installed` file is 1064 kB in the GZ, but 4806 kB in the LXC container (2401 kB on disk because of ZFS compression).
I would not think this difference in the file size causes the delay, or does it?
Any clues would be appreciated, or tips what other tests I should run.