Skip to content

Arch Linux Arch Build System

Mattscreative edited this page Dec 5, 2025 · 2 revisions

Arch Linux Arch Build System Guide

Complete beginner-friendly guide to the Arch Build System (ABS), including building packages from source, creating custom packages, and PKGBUILD creation.


Table of Contents

  1. Understanding ABS
  2. Installing ABS
  3. Building Packages
  4. Creating PKGBUILDs
  5. Troubleshooting

Understanding ABS

What is ABS?

Arch Build System builds packages from source.

Components:

  • PKGBUILD: Build script
  • makepkg: Build tool
  • AUR: User repository

Installing ABS

Install Tools

Install build tools:

# Install base-devel
sudo pacman -S base-devel

# Install asp (for official packages)
sudo pacman -S asp

Building Packages

Get PKGBUILD

From AUR:

# Clone AUR package
git clone https://aur.archlinux.org/package-name.git
cd package-name

From official:

# Get package
asp checkout package-name
cd package-name/trunk

Build Package

Build:

# Build package
makepkg -s

# Install
makepkg -si

Creating PKGBUILDs

PKGBUILD Structure

Basic PKGBUILD:

pkgname=package-name
pkgver=1.0.0
pkgrel=1
pkgdesc="Package description"
arch=('x86_64')
url="https://example.com"
license=('GPL')
depends=('dependency')
source=("https://example.com/package.tar.gz")
md5sums=('checksum')

build() {
    cd "$srcdir/$pkgname-$pkgver"
    ./configure --prefix=/usr
    make
}

package() {
    cd "$srcdir/$pkgname-$pkgver"
    make DESTDIR="$pkgdir" install
}

Troubleshooting

Build Failures

Check logs:

# Check build log
cat ~/.makepkg.log

# Clean build
makepkg -c

Summary

This guide covered ABS, building packages, and creating PKGBUILDs.


Next Steps


This guide is based on the ArchWiki. For the most up-to-date information, always refer to the official ArchWiki.

Clone this wiki locally