---
name: "abuild"
section: "1"
platform: "linux"
package: "abuild"
version: "3.17.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/abuild"
---

# abuild(1)

build an apk from an APKBUILD

## NAME

**abuild** - build an apk from an APKBUILD

## SYNOPSIS

**abuild** \[options\] \[-C DIR\] \[-P *REPODEST*\] \[-s *SRCDEST*\] \[-D *DESCRIPTION*\] \[cmd\] ...

## DESCRIPTION

**abuild** builds an apk binary package based on an input [APKBUILD(5)](/APKBUILD/5.md), as well as other related operations.

## OPTIONS

- **-A**

  Print CARCH and exit

- **-c**

  Enable colored output

- **-C DIR**

  Change directory to DIR before running any commands

- **-d**

  Disable dependency checking

- **-D DESCRIPTION**

  Set APKINDEX description (default: **$repo $(git describe)**)

- **-f**

  Force specified cmd (skip checks: apk up to date, arch)

- **-F**

  Force run as root

- **-h**

  Show this help

- **-k**

  Keep built packages, even if APKBUILD or sources are newer

- **-K**

  Keep buildtime temp dirs and files (srcdir/pkgdir/deps)

- **-m**

  Disable colors (monochrome)

- **-P REPODEST**

  Set REPODEST as the repository location for created packages

- **-q**

  Quiet

- **-r**

  Install missing dependencies from system repository

- **-s SRCDEST**

  Set source package destination directory to SRCDEST

- **-v**

  Verbose: show every command as it is run (very noisy)

## COMMANDS

**all**

Runs the entire build process. This is the default when no other command is specified, and is roughly an alias for **validate builddeps clean fetch** **unpack prepare mkusers build check rootpkg**.

**build**

Compile and install package into **$pkgdir**.

**check**

Run any defined tests concerning the package

**checksum**

Generate checksum to be included in APKBUILD

**clean**

Remove temp build and install dirs

**cleancache**

Remove downloaded files from $SRCDEST

**cleanoldpkg**

Remove binary packages except current version

**cleanpkg**

Remove already built binary and source package

**deps**

Install packages listed in makedepends and depends

**fetch**

Fetch sources to $SRCDEST

**index**

Regenerate indexes in $REPODEST

**listpkg**

List target packages

**package**

Install project into

**prepare**

Apply patches

**rootbld**

Build package in clean chroot. Requires **abuild-rootbld**.

**rootpkg**

Run 'package', the split functions and create apks as fakeroot

**validate**

Basic validation of APKBUILD

**snapshot**

Create a **$giturl** snapshot and upload to **$disturl**

**sourcecheck**

Check if remote source package exists upstream

**srcpkg**

Make a source package

**undeps**

Uninstall packages listed in makedepends and depends

**unpack**

Unpack sources to $srcdir

**up2date**

Compare target and sources dates

## ENVIRONMENT

**APKBUILD**

Override path to **APKBUILD** file.

**BOOTSTRAP**

Used when bootstrapping with no existing packages by minimising build dependencies. This flag only has an effect on a few select packages.

A value of *nocc* omits any compilation (e.g.: include only source headers). A value of *nolibc* assumes that no *libc* is available.

This list of values is not exhaustive.

**CHOST**

Generate packages for given arch or triplet.

**CTARGET**

Generate compiler for given arch or triplet.

**PACKAGER**

Name and email of the packages in RFC5322 format. E.g.: **John Doe \<john@example.com\>**.

**PACKAGER\_PRIVKEY**

Path to a private key used to sign packages.

**REPODEST**

Packages shall be stored in *$REPODEST/$repo/$arch/$pkgname-$pkgver-r$pkgrel.apk*, where **$repo** is the base name of the parent directory of **$startdir**.

**SOURCE\_DATE\_EPOCH**

Use this timestamp as a reference for reproducible builds. See **https://reproducible-builds.org/docs/source-date-epoch/**

**SUDO\_APK**

Command to use to run apk as root. Defaults to **abuild-apk**.

**USE\_CCACHE**

If set to a non-empty value, enables **ccache** support.

**USE\_COLORS**

If set to a non-empty value, print coloured output using ANSI escape sequences.

## FILES

/etc/abuild.conf

Configuration is read from this file by default.

$HOME/.abuild/abuild.conf

User-specific configuration is read from this file, if it exists.

## EXAMPLES

Update checksums for an APKBUILD:

```
abuild checksum
```

Build an APKBUILD and print coloured output:

```
abuild -rc
```

## SEE ALSO

SPDX license reference (on the Web at \<https://spdx.org/licenses/\>), [newapkbuild(1)](/newapkbuild/1.md), [apk(8)](/apk/8.md), [APKBUILD(5)](/APKBUILD/5.md), [abuild.conf(5)](/abuild.conf/5.md), buildrepo(1), ap(1), checkapk(1).

## AUTHORS

**abuild**: Natanael Copa \<*ncopa@alpinelinux.org*\>

Documentation:\
 Hugo Osvaldo Barrera \<*hugo@whynothugo.nl*\>
