# Arch Software Use for pacman, packages, AUR, PKGBUILD, makepkg, app install/build issues. ## Pacman Query Map ```sh pacman -Ss term # sync DB search pacman -Si package # sync pkg info pacman -Qs term # installed search pacman -Qi package # installed pkg info pacman -Ql package # installed files pacman -Qo /path/file # file owner pacman -Qm # foreign/local/AUR pacman -Qtdq # orphan deps pacman -F path # remote file owner; needs files DB ``` Refresh files DB only when needed: `pacman -Fy`. ## Install/Remove - Install from repos: `pacman -S package` if DB current; otherwise full upgrade flow. - Full upgrade: `pacman -Syu`. - Install local pkg: `pacman -U ./pkg.pkg.tar.zst`. - Remove package + unneeded deps: `pacman -Rs package`. - Avoid `-Rsc`, `-Rdd`, `--nodeps`, `--overwrite` unless explicitly justified. - Use `--print`/`--print-format` for dry/processable transaction previews. ## AUR AUR is unsupported/untrusted user content. Agent must inspect before build/install: ```sh less PKGBUILD ls -la git diff @~..@ # if updating existing clone ``` Check for: - unexpected network/code exec in build funcs - dangerous `install` scripts - checksum/PGP handling - bundled patches - dependency sanity Build rules: - `base-devel` is assumed by AUR packages. - Run `makepkg` as normal user, never root. - `makepkg -s` can install repo deps via pacman; AUR deps need separate handling. - `makepkg --verifysource` checks sources without building. - `makepkg --printsrcinfo` for metadata. - Clean chroot helps distinguish user-env failure from broken PKGBUILD. AUR helpers do not remove review duty. ## PKGBUILD Facts Current truth: `man PKGBUILD`, `man makepkg`. Durable basics: - PKGBUILD is Bash sourced by `makepkg`; treat as executable code. - Minimal fields include `pkgname`, `pkgver`, `pkgrel`, `arch`. - `package()` installs into `$pkgdir`; `prepare()`, `build()`, `check()` optional. - `backup=()` controls pacnew/pacsave behavior for config files. - `source=()` + checksums/PGP define source verification. - Split packages use multiple `pkgname`s and `package_name()` funcs. ## Current Sources - Man: `pacman(8)`, `makepkg(8)`, `PKGBUILD(5)`, `makepkg.conf(5)` - Wiki: `Pacman`, `Arch User Repository`, `Creating packages`, `Makepkg` - Live: `archlinux.org/packages`, `aur.archlinux.org`