6

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 1

4

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 
3
  • 2
    Make sure to copy your public rsa key located in ~/.abuild (created by abuild-keygen) to /etc/apk/keys. If you run abuild-keygen -ain, this is done automatically. Commented Dec 1, 2020 at 8:19
  • I tried running abuild package and it finishes without error but no package is output in ~/packages -- what abuild step puts it there? Commented Mar 24, 2023 at 5:49
  • 1
    @rakslice I just run abuild -r after setting up according to this wiki page: wiki.alpinelinux.org/wiki/Creating_an_Alpine_package Commented Mar 24, 2023 at 12:53

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.