Arch Linux Arch Build System - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
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
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
- Arch Linux Package Management - Package management
- Arch Linux Development Environment - Development
- ArchWiki ABS: https://wiki.archlinux.org/title/Arch_Build_System
This guide is based on the ArchWiki. For the most up-to-date information, always refer to the official ArchWiki.