Skip to content

apk: v2 package format error #2133

Description

@mcandre

When I use fpm to generate Alpine .apk packages, then Alpine is unable to install them.

Trace:

% fpm -t apk -p bin/install-media/alpine/buttery-0.0.22.x86_64.apk --architecture x86_64 bin/buttery-0.0.22/linux/amd64/buttery=/usr/bin/buttery

% cd bin/install-media/alpine
% file buttery-0.0.22.x86_64.apk
buttery-0.0.22.x86_64.apk: gzip compressed data, last modified: Fri Jan 30 21:25:55 2026, from Unix, original size modulo 2^32 2819584
% gunzip -vl buttery-0.0.22.x86_64.apk
method  crc     date  time    compressed uncompressed  ratio uncompressed_name
defla 7707e9d1 Jan 30 15:25      1661781      2819584  41.0% buttery-0.0.22.x86_64.apk
% head -c 256 buttery-0.0.22.x86_64.apk | xxd
00000000: 1f8b 0800 e321 7d69 0003 dd90 c14e c330  .....!}i.....N.0
00000010: 0c86 7bee 5358 e2de 3a69 e8d0 24ae 4c08  ..{.SX..:i..$.L.
00000020: 0978 0394 36a6 8d58 922a 7106 e3e9 4991  .x..6..X.*q...I.
00000030: 76d9 154d 08be 8be5 df76 f2db cdf3 c3ee  v..M.....v......
00000040: fef1 eea9 ba20 58e8 95fa 8e85 f388 b2c7  ..... X.........
00000050: 4a5c 8b6e 2325 6e54 57a1 109d 1415 e025  J\.n#%nTW......%
00000060: 4d9d c889 752c 567e face f972 7f84 2bd8  M...u,V~...r..+.
00000070: 91a7 a899 0c0c 4778 5d5c bdbc 4d5e 3b82  ......Gx]\..M^;.
00000080: 5b18 3233 c5e3 aa1c 2816 011b 6ca4 ac75  [.23....(...l..u
00000090: 1ce7 927d dcf4 2fbd 5aab 86d2 5804 0d07  ...}../.Z...X...
000000a0: 6b28 0019 cb21 c2bb e519 9cf6 59ef c105  k(...!......Y...
000000b0: b6c1 4372 21f0 6cfd 54e7 b82f 1333 f392  ..Cr!.l.T../.3..
000000c0: b66d 3b95 d63c 3463 70ad 1bb5 3791 dad3  .m;..<4cp...7...
000000d0: e7c9 7eae 5e04 4a85 58ff f6bd fe1b 5f54  ..~.^.J.X....._T
000000e0: af88 1200 0400 001f 8b08 00e3 217d 6900  ............!}i.
000000f0: 03ec bd09 7c53 55da 309e b469 1ba0 7083  ....|SU.0..i..p.

% docker run --rm -it -v "$(pwd):/src" alpine ash

# cd /src
# apk add -v --allow-untrusted buttery-0.0.22.x86_64.apk
ERROR: buttery-0.0.22.x86_64.apk: v2 package format error
# echo "$?"
99

# cat /etc/*release*
3.23.3
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.23.3
PRETTY_NAME="Alpine Linux v3.23"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"

Using fpm 1.17.0, Ruby 4.0.1, asdf 0.18.0, on a macOS Sequoia host.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions