AUR & Helpers

The Arch User Repository (AUR) is a community-driven repository of PKGBUILDs.

Understanding AUR

What is AUR?

  • Community-maintained package build scripts (PKGBUILDs)

  • NOT pre-built binaries (you compile locally)

  • NOT officially supported by Arch Linux

  • Always review PKGBUILDs before building

Manual AUR Installation

Traditional method without helpers:

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

# Review PKGBUILD
less PKGBUILD

# Build and install
makepkg -si

AUR Helpers

Comparison

Helper Written In Features

yay

Go

Most popular, pacman syntax

paru

Rust

Modern, feature-rich

pikaur

Python

Review before build

trizen

Perl

Minimal, fast

Install yay

# Install dependencies
sudo pacman -S --needed git base-devel

# Clone and build
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

Install paru

sudo pacman -S --needed git base-devel
git clone https://aur.archlinux.org/paru.git
cd paru
makepkg -si

Using yay

Basic Operations

# Search AUR
yay -Ss package

# Install from AUR
yay -S package

# Update all (repos + AUR)
yay -Syu

# Update AUR only
yay -Sua

# Remove package
yay -Rns package

yay-Specific Features

# Interactive search and install
yay package

# Show statistics
yay -Ps

# Clean unneeded dependencies
yay -Yc

# Generate development package updates
yay -Syu --devel

Configuration

yay config at ~/.config/yay/config.json:

# Generate default config
yay --save --answerdiff None --answerclean None --removemake

# View current config
yay -Pg

Using paru

Basic Operations

# Search
paru -Ss package

# Install
paru -S package

# Update all
paru -Syu

# Interactive install
paru package

paru-Specific Features

# Show PKGBUILD diff before upgrade
paru -Sua

# Skip review
paru -S package --skipreview

# Clean cache
paru -Sc

# Show reverse dependencies
paru -Sii package

Configuration

Edit ~/.config/paru/paru.conf:

[options]
SkipReview
BottomUp
SudoLoop
CleanAfter

Best Practices

Security

# Always review PKGBUILD before installing
yay -S package  # Will show diff by default

# Check comments on AUR page
xdg-open https://aur.archlinux.org/packages/package-name

# Verify source URLs in PKGBUILD

Maintenance

# List AUR packages
pacman -Qm

# Check for orphaned AUR packages
yay -Qm | while read pkg _; do
  curl -s "https://aur.archlinux.org/rpc?v=5&type=info&arg=$pkg" | grep -q '"resultcount":0' && echo "$pkg"
done

# Rebuild package after dependency update
yay -S package --rebuild

Troubleshooting Builds

# Build in clean chroot
yay -S package --chroot

# Skip PGP verification (use cautiously)
yay -S package --mflags "--skippgpcheck"

# Edit PKGBUILD before build
yay -S package --editmenu

Creating Packages

PKGBUILD Template

# Maintainer: Your Name <email@example.com>
pkgname=mypackage
pkgver=1.0.0
pkgrel=1
pkgdesc="Description of package"
arch=('x86_64')
url="https://example.com"
license=('MIT')
depends=('dependency1' 'dependency2')
makedepends=('git')
source=("$pkgname-$pkgver.tar.gz::https://example.com/source.tar.gz")
sha256sums=('SKIP')

build() {
    cd "$pkgname-$pkgver"
    make
}

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

Build and Test

# Validate PKGBUILD
namcap PKGBUILD

# Build without installing
makepkg

# Build and install
makepkg -si

# Test in clean environment
extra-x86_64-build