I have an APKBUILD and associated files (patches, et cetera), and I would like to build and install it locally. I'm aware that I can build it with abuild, but this doesn't seem to keep the package afterwards. How do I build and install a package from an APKBUILD in Alpine Linux?
1 Answer
Actually, abuild does keep the built .apk package. It will be placed in a local repository created by abuild that's located in ~/packages. If you want, you can add this to your repository list by adding the path in /etc/apk/repositories. You will have to add a separate entry for each channel you want to install packages built for, so if you want to include the three of testing, community, and main you'd have to add something like this to the file:
/home/<username>/packages/main /home/<username>/packages/community /home/<username>/packages/testing You will then be able to install the package the usual way:
# apk add <package name> There is also the option of just installing the apk directly by doing something like this:
# apk add ~/packages/<channel>/<architecture/<package name>-<package version>.apk For example:
# apk add ~/packages/testing/x86_64/giara-0.2-r0.apk - 2Make sure to copy your public rsa key located in
~/.abuild(created by abuild-keygen) to/etc/apk/keys. If you runabuild-keygen -ain, this is done automatically.Ikke– Ikke2020-12-01 08:19:19 +00:00Commented Dec 1, 2020 at 8:19 - I tried running
abuild packageand it finishes without error but no package is output in~/packages-- whatabuildstep puts it there?rakslice– rakslice2023-03-24 05:49:18 +00:00Commented Mar 24, 2023 at 5:49 - 1@rakslice I just run
abuild -rafter setting up according to this wiki page: wiki.alpinelinux.org/wiki/Creating_an_Alpine_packageNewbyte– Newbyte2023-03-24 12:53:06 +00:00Commented Mar 24, 2023 at 12:53