Thank you for confirming that nothing between the configuration and the package manager is interlinked. Your status in the community precedes you. I have used your R7800 community builds way back when I started using OpenWRT and know of your contributions. Thanks @hnyman!
May have missed it in my searches, but is there a way to ensure apk has the same access to all the packages that opkg had / has?
root@OWRT-X10:~# echo $?
1
root@OWRT-X10:~# apk add ipcalc
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/arm_cortex-a15_neon-vfpv4/APKINDEX.tar.gz
WARNING: updating and opening https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base: remote server returned error (try 'apk update')
fetch https://downloads.openwrt.org/snapshots/targets/alpine/generic/packages/packages.adb
WARNING: updating and opening https://downloads.openwrt.org/snapshots/targets/alpine/generic/packages/packages.adb: remote server returned error (try 'apk update')
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/alpinefancontrol/packages.adb
WARNING: updating and opening https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/alpinefancontrol/packages.adb: remote server returned error (try 'apk update')
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/egorenar_custom/packages.adb
WARNING: updating and opening https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/egorenar_custom/packages.adb: remote server returned error (try 'apk update')
ERROR: unable to select packages:
ipcalc (no such package):
required by: world[ipcalc]
root@OWRT-X10:~#
Using MasBit's OpenWRT for the Netgear X10 R9000.
It looks like your feeds list is missing some repos. Here's mine on x86_64
, which would change to arm_cortex-a15_neon-vfpv4
on your device (and the kmods will be in a completely different location and depend on the build).
$ cat /etc/apk/repositories.d/distfeeds.list
https://downloads.openwrt.org/snapshots/targets/x86/64/packages/packages.adb
https://downloads.openwrt.org/snapshots/packages/x86_64/base/packages.adb
https://downloads.openwrt.org/snapshots/targets/x86/64/kmods/6.6.87-1-6a81f3b8146e43ad1f97f97456abf576/packages.adb
https://downloads.openwrt.org/snapshots/packages/x86_64/luci/packages.adb
https://downloads.openwrt.org/snapshots/packages/x86_64/packages/packages.adb
https://downloads.openwrt.org/snapshots/packages/x86_64/routing/packages.adb
https://downloads.openwrt.org/snapshots/packages/x86_64/telephony/packages.adb
https://downloads.openwrt.org/snapshots/packages/x86_64/video/packages.adb
The last three feeds in your list, alpine
, alpinefancontrol
and egorenar_custom
, don't exist (at least in the OpenWrt feeds), so you'll have to look into that.
I was thinking that ipcalc
was part of the base build and probably included in the base package in older OpenWrt versions but I didn't find it on my 24.10 system or on snapshot. I might not remember correctly.
24.10.0 system:
root@R4S-wrt:/# opkg search ipcalc
root@R4S-wrt:/# opkg list | grep ipcalc
libowipcalc - 7 - The owipcalc library supports a number of calculations and tests to work with ip-address ranges, this is useful for programms that e.g. need to partition ipv6-prefixes into small subnets or to calculate address ranges for dhcp pools.
owipcalc - 7 - The owipcalc utility supports a number of calculations and tests to work with ip-address ranges, this is useful for scripts that e.g. need to partition ipv6-prefixes into small subnets or to calculate address ranges for dhcp pools.
Note the difference in name from what you tried. Perhaps the one I show is what you need.
Snapshot:
root@OWrtSNAPSHOT:~# apk search ipcalc
libowipcalc-7
owipcalc-7
root@OWrtSNAPSHOT:~# apk add owipcalc
(1/2) Installing libowipcalc (7)
libowipcalc-7.post-install: Executing script...
(2/2) Installing owipcalc (7)
owipcalc-7.post-install: Executing script...
OK: 27 MiB in 185 packages
root@OWrtSNAPSHOT:~# owipcalc --help
Usage:
owipcalc {base address} operation [argument] [operation [argument] ...]
Operations:
add {ipv4/ipv6/amount}
Add argument to base address.
Applicable to ipv4- and ipv6-addresses.
sub {ipv4/ipv6/amount}
Substract argument from base address.
Applicable to ipv4- and ipv6-addresses.
next {ipv4/ipv6/amount}
Advance base address to next prefix of given size.
Applicable to ipv4- and ipv6-addresses.
prev {ipv4/ipv6/amount}
Lower base address to previous prefix of give size.
Applicable to ipv4- and ipv6-addresses.
network
Turn base address into network address.
Applicable to ipv4- and ipv6-addresses.
broadcast
Turn base address into broadcast address.
Only applicable to ipv4-addresses.
prefix {ipv4/ipv6/amount}
Set the prefix of base address to argument.
Applicable to ipv4- and ipv6-addresses.
netmask
Calculate netmask of base address.
Only applicable to ipv4-addresses.
6to4
Calculate 6to4 prefix of given ipv4-address.
Only applicable to ipv4-addresses.
howmany {ipv4/ipv6/amount}
Print amount of righ-hand prefixes that fit into base address.
Applicable to ipv4- and ipv6-addresses.
contains {ipv4/ipv6/amount}
Print '1' if argument fits into base address or '0' if not.
Applicable to ipv4- and ipv6-addresses.
private
Print '1' if base address is in RFC1918 private space or '0' if not.
Only applicable to ipv4-addresses.
linklocal
Print '1' if base address is in 169.254.0.0/16 or FE80::/10 link local space or '0' if not.
Applicable to ipv4- and ipv6-addresses.
ula
Print '1' if base address is in FC00::/7 unique local address (ULA) space or '0' if not.
Only applicable to ipv6-addresses.
quiet
Suppress output, useful for test operation where the result can be inferred from the exit code.
Applicable to ipv4- and ipv6-addresses.
pop
Pop intermediate result from stack.
Applicable to ipv4- and ipv6-addresses.
print
Print intermediate result and pop it from stack, invoked implicitely at the end of calculation if no intermediate prints happened.
Applicable to ipv4- and ipv6-addresses.
Examples:
Calculate a DHCP range:
$ owipcalc 192.168.1.1/255.255.255.0 network add 100 print add 150 print
192.168.1.100
192.168.1.250
Count number of prefixes:
$ owipcalc 2001:0DB8:FDEF::/48 howmany ::/64
65536
root@OWrtSNAPSHOT:~#
Awesome guy's! Both suggestions worked @spence @efahl to clear up most of the issues!
Additional question. One last package tar.gz isn't loading. Can't pin point where that's defined or how to fix this and https://dev.melmac.net/apk/all/APKINDEX.tar.gz doesn't exist anymore:
root@OWRT-Khufu:/etc/apk/repositories.d# apk update
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/arm_cortex-a15_neon-vfpv4/APKINDEX.tar.gz
WARNING: updating and opening https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base: remote server returned error (try 'apk update')
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/telephony/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/video/packages.adb
fetch https://downloads.openwrt.org/snapshots/targets/x86/64/packages/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/x86_64/base/packages.adb
fetch https://downloads.openwrt.org/snapshots/targets/x86/64/kmods/6.6.87-1-6a81f3b8146e43ad1f97f97456abf576/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/x86_64/luci/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/x86_64/packages/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/x86_64/routing/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/x86_64/telephony/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/x86_64/video/packages.adb
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/telephony/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/video/packages.adb]
[https://downloads.openwrt.org/snapshots/targets/x86/64/packages/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/x86_64/base/packages.adb]
[https://downloads.openwrt.org/snapshots/targets/x86/64/kmods/6.6.87-1-6a81f3b8146e43ad1f97f97456abf576/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/x86_64/luci/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/x86_64/packages/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/x86_64/routing/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/x86_64/telephony/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/x86_64/video/packages.adb]
1 unavailable, 0 stale; 20190 distinct packages available
root@OWRT-Khufu:/etc/apk/repositories.d#
root@OWRT-Khufu:/etc/apk/repositories.d#
root@OWRT-Khufu:/etc/apk/repositories.d#
root@OWRT-Khufu:/etc/apk/repositories.d# cat distfeeds.list
# https://downloads.openwrt.org/snapshots/targets/alpine/generic/packages/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/packages.adb
# https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/alpinefancontrol/packages.adb
# https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/egorenar_custom/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/telephony/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/video/packages.adb
#
https://downloads.openwrt.org/snapshots/targets/x86/64/packages/packages.adb
https://downloads.openwrt.org/snapshots/packages/x86_64/base/packages.adb
https://downloads.openwrt.org/snapshots/targets/x86/64/kmods/6.6.87-1-6a81f3b8146e43ad1f97f97456abf576/packages.adb
https://downloads.openwrt.org/snapshots/packages/x86_64/luci/packages.adb
https://downloads.openwrt.org/snapshots/packages/x86_64/packages/packages.adb
https://downloads.openwrt.org/snapshots/packages/x86_64/routing/packages.adb
https://downloads.openwrt.org/snapshots/packages/x86_64/telephony/packages.adb
https://downloads.openwrt.org/snapshots/packages/x86_64/video/packages.adb
root@OWRT-Khufu:/etc/apk/repositories.d#
It looks like you have stuff defined that may not be official OpenWrt so support here may be limited.
I think repository info is normally defined in 2 files in /etc/apk/repositories.d/
customfeeds.list distfeeds.list
I took a quick look and you may find the documentation at stangri's site helpful. https://docs.openwrt.melmac.net/
Oops! Sorry, I shouldn't attempt critical thinking before coffee.
Maybe your apk cache has outdated info. I have not used it but there may be some cache options like clean
and purge
that might help. apk cache --help
showed me some more help and the docs at alpine's site might help. There are some docs here on OpenWrt you should check too. Look at the first couple of posts in this thread. Hopefully you get a direct answer as well.
Reply 2.
I don't know about the mystery download attempt but it looks like you are missing targets and kmods...
You should be able to get the target info from command ubus call system board
That info likely plugs right in to the download url.
You also need to correlate the kernel version for the kmods, possibly through the build date.
As an example, for a NETGEAR R7800 which looks to use the same arch
as your distsfeeds
file, for the build of Wed Apr 30 15:09:02 2025, the urls
are: https://downloads.openwrt.org/snapshots/targets/ipq806x/generic/packages/packages.adb
and https://downloads.openwrt.org/snapshots/targets/ipq806x/generic/kmods/6.6.87-1-78a9b7c5c14a7868ab052bdb5120995c/packages.adb
Iit may be good to update to the current SNAPSHOT or a very recent one, Especially if your SNAPSHOT is getting old, as updates will be unavailable at some point.
I'm thinking a clean install without keeping settings should get your distfeeds file correct. You'd have to restore all your other settings though.
Try
https://dev.melmac.net/apk
without the /all
.
You should not have any x86_64 feeds in your distfeeds.list, they should all be arm_cortex-a15_neon-vfpv4.
The kmod feed needs to be specific to the exact git commit from which the kernel was built (or in them more likely case that you have no need for extra kmods, just delete it).
Still stuck a bit where that APKINDEX.tar.gz is coming from:
root@OWRT-Khufu:~# apk update
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/arm_cortex-a15_neon-vfpv4/APKINDEX.tar.gz
WARNING: updating and opening https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base: remote server returned error (try 'apk update')
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/telephony/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/video/packages.adb
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/telephony/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/video/packages.adb]
1 unavailable, 0 stale; 8658 distinct packages available
root@OWRT-Khufu:~# vi /etc/apk/repositories.d/distfeeds.list
root@OWRT-Khufu:~#
root@OWRT-Khufu:~#
root@OWRT-Khufu:~# cd /etc/
root@OWRT-Khufu:/etc# grep -EiR melmac
^C
root@OWRT-Khufu:/etc# cd apk
root@OWRT-Khufu:/etc/apk# grep -EiR melmac
l^C
root@OWRT-Khufu:/etc/apk# ls -altri
28 drwxr-xr-x 2 root root 66 Dec 11 05:36 keys
67 -rw-r--r-- 1 root root 26 Dec 11 05:36 arch
287 -rw-r--r-- 1 root root 80 May 3 17:23 repositories
916 -rw-r--r-- 1 root root 4148 May 5 01:44 world
27 drwxr-xr-x 1 root root 368 May 5 01:45 .
9 drwxr-xr-x 1 root root 1560 May 8 00:49 ..
29 drwxr-xr-x 1 root root 312 May 8 00:56 repositories.d
root@OWRT-Khufu:/etc/apk# tree
.
โโโ arch
โโโ keys
โ โโโ openwrt-snapshots.pem
โ โโโ public-key.pem
โโโ repositories
โโโ repositories.d
โ โโโ customfeeds.list
โ โโโ distfeeds.list
โ โโโ distfeeds.list-bk01
โโโ world
3 directories, 8 files
root@OWRT-Khufu:/etc/apk# cd repositories.d/
root@OWRT-Khufu:/etc/apk/repositories.d# cat customfeeds.list
# add your custom package feeds here
#
# http://www.example.com/path/to/files/packages.adb
root@OWRT-Khufu:/etc/apk/repositories.d# cd ..
root@OWRT-Khufu:/etc/apk# cat repositories
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base
root@OWRT-Khufu:/etc/apk# cat repositories.d/
customfeeds.list distfeeds.list distfeeds.list-bk01
root@OWRT-Khufu:/etc/apk# cat repositories.d/distfeeds.list
# https://downloads.openwrt.org/snapshots/targets/alpine/generic/packages/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/packages.adb
# https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/alpinefancontrol/packages.adb
# https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/egorenar_custom/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/telephony/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/video/packages.adb
root@OWRT-Khufu:/etc/apk# cat repositories.d/customfeeds.list
# add your custom package feeds here
#
# http://www.example.com/path/to/files/packages.adb
root@OWRT-Khufu:/etc/apk#
Removed the x86 repositories. Ty for that.
Output of ubus:
root@OWRT-Khufu:/etc/apk# ubus call system board
{
"kernel": "6.6.63",
"hostname": "OWRT-Khufu.mds.xyz",
"system": "ARMv7 Processor rev 4 (v7l)",
"model": "Annapurna Labs Alpine Dev Board",
"board_name": "netgear,r9000",
"rootfs_type": "squashfs",
"release": {
"distribution": "OpenWrt",
"version": "SNAPSHOT",
"revision": "r28285-3fe891d0c5",
"target": "alpine/generic",
"description": "OpenWrt SNAPSHOT r28285-3fe891d0c5",
"builddate": "1733913412"
}
}
root@OWRT-Khufu:/etc/apk#
Somehow this path:
is generated from another entry. But I can't pin point it. This site:
https://dev.melmac.net/apk
with or without /all doesn't appear to have that APKINDEX.tar.gz package. Reading the other links provided a bit further.
Tried to check what files this opens up but that APKINDEX.tar.gz seems baked deep into some package that I have listed in the distfeeds.list it appears:
root@OWRT-Khufu:/etc/apk/repositories.d# strace -s 256 -f apk update 2>&1 | grep -Ei "open\("|grep -v "etc/ssl/certs/"|grep -Evi "No such file"|grep -Eiv "etc/hosts|usr/lib|dev/urandom"
open("/lib/libgcc_s.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3409] open("/lib/libubox.so.20240329", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3409] open("/lib/libgcc_s.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3409] open("/lib/libustream-ssl.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3409] open("/etc/resolv.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 6
[pid 3410] open("/lib/libubox.so.20240329", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3410] open("/lib/libgcc_s.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3410] open("/lib/libustream-ssl.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3410] open("/etc/resolv.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 6
[pid 3411] open("/lib/libubox.so.20240329", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3411] open("/lib/libgcc_s.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3411] open("/lib/libustream-ssl.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3411] open("/etc/resolv.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 6
[pid 3412] open("/lib/libubox.so.20240329", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3412] open("/lib/libgcc_s.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3412] open("/lib/libustream-ssl.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3412] open("/etc/resolv.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 6
[pid 3417] open("/lib/libubox.so.20240329", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3417] open("/lib/libgcc_s.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3417] open("/lib/libustream-ssl.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3417] open("/etc/resolv.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 6
[pid 3418] open("/lib/libubox.so.20240329", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3418] open("/lib/libgcc_s.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3418] open("/lib/libustream-ssl.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3418] open("/etc/resolv.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 6
[pid 3419] open("/lib/libubox.so.20240329", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3419] open("/lib/libgcc_s.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3419] open("/lib/libustream-ssl.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
[pid 3419] open("/etc/resolv.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 6
root@OWRT-Khufu:/etc/apk/repositories.d#
root@OWRT-Khufu:/etc/apk/repositories.d#
root@OWRT-Khufu:/etc/apk/repositories.d#
root@OWRT-Khufu:/etc/apk/repositories.d#
root@OWRT-Khufu:/etc/apk/repositories.d#
root@OWRT-Khufu:/etc/apk/repositories.d#
root@OWRT-Khufu:/etc/apk/repositories.d#
root@OWRT-Khufu:/etc/apk/repositories.d#
root@OWRT-Khufu:/etc/apk/repositories.d#
root@OWRT-Khufu:/etc/apk/repositories.d#
root@OWRT-Khufu:/etc/apk/repositories.d#
root@OWRT-Khufu:/etc/apk/repositories.d# cat /etc/resolv.conf
search lan
nameserver 127.0.0.1
nameserver ::1
root@OWRT-Khufu:/etc/apk/repositories.d# cat distfeeds.list
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/telephony/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/video/packages.adb
root@OWRT-Khufu:/etc/apk/repositories.d#
root@OWRT-Khufu:/etc/apk/repositories.d# apk update
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/arm_cortex-a15_neon-vfpv4/APKINDEX.tar.gz
WARNING: updating and opening https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base: remote server returned error (try 'apk update')
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/telephony/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/video/packages.adb
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/telephony/packages.adb]
[https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/video/packages.adb]
1 unavailable, 0 stale; 9370 distinct packages available
root@OWRT-Khufu:/etc/apk/repositories.d#
Also, for this OpenWRT and for this Netgear X10 R9000:
root@OWRT-Khufu:~#
root@OWRT-Khufu:~# iptables-translate -I FORWARD -p tcp -s 192.168.100.0/24 -m connlimit --connlimit-above 50 -j logdrop
nft 'add set ip filter connlimit0 { type ipv4_addr; flags dynamic; }'
nft 'insert rule ip filter FORWARD ip protocol tcp ip saddr 192.168.100.0/24 add @connlimit0 { ip saddr ct count over 50 } counter jump logdrop'
root@OWRT-Khufu:~# nft 'add set ip filter connlimit0 { type ipv4_addr; flags dynamic; }'
root@OWRT-Khufu:~# nft 'insert rule ip filter FORWARD ip protocol tcp ip saddr 192.168.100.0/24 add @connlimit0 { ip saddr ct count over 50 } counter jump logdrop'
Error: Could not process rule: No such file or directory
insert rule ip filter FORWARD ip protocol tcp ip saddr 192.168.100.0/24 add @connlimit0 { ip saddr ct count over 50 } counter jump logdrop
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
root@OWRT-Khufu:~#
'nft' doesn't support connection counters ( ct count over 50 ). The source I've used is:
That's one of the package index names used by apk
when you apk update
. These days we normally use fully-qualified paths, but even so, apk
will try to use APKINDEX.tar.gz
if it doesn't find a packages.adb
at the location specified.
fetch https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/arm_cortex-a15_neon-vfpv4/APKINDEX.tar.gz
That URL is incorrect, as it contains the arch twice, probably due to the deprecated /etc/apk/repositories
file. Delete that and try again.
Correct, it contains the packages.adb
file that is the apk
v3 version of the package index.
Ah yes, this did the trick. Thank you again for the tips. The working files:
root@OWRT-Khufu:/etc/apk# cat repositories
# https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base
root@OWRT-Khufu:/etc/apk# cat repositories.d/
customfeeds.list distfeeds.list
root@OWRT-Khufu:/etc/apk# cat repositories.d/distfeeds.list
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/telephony/packages.adb
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/video/packages.adb
root@OWRT-Khufu:/etc/apk#
I asked this before, and after some digging I don't think it possible to specify the dependency version with apk. What I'd like to do is something similar to rpm spec:
Requires: %{name}-libs = %{version}-%{release}
This could lead to a situation like this one where a dependency is not compatible:
root@OpenWrt:/tmp# apk add libsqlite3
(1/1) Installing libsqlite3-0 (3.49.1-r2)
libsqlite3-0-3.49.1-r2.post-install: Executing script...
OK: 22 MiB in 146 packages
root@OpenWrt:/tmp# apk add --allow-untrusted ./sqlite3-cli-3.49.2-r1.apk
(1/4) Installing terminfo (6.4-r2)
terminfo-6.4-r2.post-install: Executing script...
(2/4) Installing libncurses6 (6.4-r2)
libncurses6-6.4-r2.post-install: Executing script...
(3/4) Installing libedit (20250104.3.1-r1)
libedit-20250104.3.1-r1.post-install: Executing script...
(4/4) Installing sqlite3-cli (3.49.2-r1)
sqlite3-cli-3.49.2-r1.post-install: Executing script...
OK: 23 MiB in 150 packages
root@OpenWrt:/tmp# sqlite3 -version
SQLite header and source version mismatch
2025-02-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70
2025-05-07 10:39:52 17144570b0d96ae63cd6f3edca39e27ebd74925252bbaf6723bcb2f6b4861fb1
sqlite3-cli-3.49.2
expects a matching library version to be installed (3.49.2 instead of 3.49.1), however I can install it without updating the dependency and without any complaints from apk. This exact scenario already happens in GitHub CI, when some package cache is not updated:
Testing package libsqlite3-0 in version 3.49.2 from libs/sqlite3
No pre-test.sh script available
(1/1) Installing libsqlite3-0 (3.49.2-r1)
libsqlite3-0-3.49.2-r1.post-install: Executing script...
OK: 14 MiB in 95 packages
Use package specific test.sh
Test successful
(1/1) Purging libsqlite3-0 (3.49.2-r1)
libsqlite3-0-3.49.2-r1.pre-deinstall: Executing script...
OK: 12 MiB in 94 packages
Testing package sqlite3-cli in version 3.49.2 from libs/sqlite3
No pre-test.sh script available
(1/5) Installing terminfo (6.4-r2)
terminfo-6.4-r2.post-install: Executing script...
(2/5) Installing libncurses6 (6.4-r2)
libncurses6-6.4-r2.post-install: Executing script...
(3/5) Installing libedit (20250104.3.1-r1)
libedit-20250104.3.1-r1.post-install: Executing script...
(4/5) Installing libsqlite3-0 (3.49.1-r2)
libsqlite3-0-3.49.1-r2.post-install: Executing script...
(5/5) Installing sqlite3-cli (3.49.2-r1)
sqlite3-cli-3.49.2-r1.post-install: Executing script...
OK: 15 MiB in 99 packages
Use package specific test.sh
SQLite header and source version mismatch
2025-02-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70
2025-05-07 10:39:52 17144570b0d96ae63cd6f3edca39e27ebd74925252bbaf6723bcb2f6b4861fb1
Here apk is installing incompatible library version and the CLI fails to load.
I might have missed something in the apk docs and it's possible to set the required dependency version after all. I imagine opkg has the same issue.
This specific package can be statically linked to avoid this issue (at the cost of size), but I think this affects other packages split into subpackages like nginx as well.
I'm pretty sure the answer to the question about "can you constrain dependencies" is yes. Take a look in the package database, /lib/apk/db/installed
, and you see such things as this (first one I found, but there are many):
...
P:firewall4
V:2025.03.17~b6e51575-r1
A:x86_64
S:31056
I:204800
T:This package provides an nftables-based implementation of the UCI firewall sharing the same configuration format.
U:
L:ISC
o:feeds/base/package/network/config/firewall4
m:Jo-Philipp Wich <jo@mein.io>
c:
k:1
D:kmod-nft-core kmod-nft-fib kmod-nft-nat kmod-nft-offload libc nftables-json ucode ucode>=2022.03.22 ucode-mod-fs ucode-mod-ubus ucode-mod-uci
p:uci-firewall
...
which requires ucode
version >=2022.03.22 for this version of fw4
. The requirement should be in the fw4 Makefile, probably in its DEPENDS
list.
EDIT: fix missing version in last paragraph.
Aha, in case you didn't find it yet, looks like EXTRA_DEPENDS
is how you do it:
Thanks. EXTRA_DEPENDS
works with apk. It's strange that setting a dependency version doesn't seem to be documented in the apk docs: