pacman package manager
Managing pacman
packages in Arch Linux and derivatives (Manjaro, endeavourOS).
Generating a list of packages¶
List non-AUR, explicitly installed packages:
List AUR packages:
List all explicitly installed packages:
Install packages from a list¶
Arch User Repository (AUR)¶
The Arch User Repository (AUR) hosts community-contributed PKGBUILD
s, instructions to download and build a packages.
While you could clone the PKGBUILD
files and run makepkg -si
manually, AUR helpers automate these process, giving a similar experience for installing regular packages in pacman
.
pikaur¶
pikaur
reviews PKGBUILDs all in once and asks all questions before installing/building, using systemd dynamic users to spawn build processes.
You can install pikaur
by another AUR helper, for example:
Afterwards, you can install AUR packages as if installing regular ones
To update all packages
paru¶
paru
is an AUR helper written in Rust.
yay -S paru-bin # If you don't want to compile the Rust code
# yay -S paru # Compile paru from source
Afterward, you can install AUR packages as if installing regular ones
To update all packages
yay¶
yay is an AUR helper written in Go and is directly available in Manjaro/EnOS.
You can install AUR packages as if installing regular ones
To update all packages, just type
Default options for yay could be saved using yay --save <options>
, for example:
yay --answerclean All --answerdiff None --answerupgrade None --cleanafter --batchinstall --combinedupgrade --sudoloop --save
Explanation:
- --cleanafter
: clean untracked files after build.
- --combinedupgrade
: resolve dependency and then install both the repo and the AUR packages in one go.
- --sudoloop
: Loop sudo calls in the background to prevent sudo from timing out during long builds.
- --batchinstall
: Build all AUR packages and install them at once.
Compilation options for AUR packages¶
To customize compilation options, a good starting point is to copy from the system-wide config file:
to you own ~/.makepkg.conf
makepkg@ArchWiki. However, PKGBUILD
settings in the packages still have higher priorities and can override your settings.
CPU target for building optimized binaries¶
CFLAGS="-march=native -O2 -pipe -fstack-protector-strong -fno-plt"
CXXFLAGS="${CFLAGS}"
RUSTFLAGS="-C opt-level=2 -C target-cpu=native"
Parallel compilation¶
Compressing packages¶
# multiple cores on compression of xz archives
COMPRESSXZ=(xz -c -z - --threads=0)
# multiple cores on compression of zstd archives
COMPRESSZST=(zstd -c -z -q - --threads=0)
# multiple cores on compression of gz archives (requires pigz package)
COMPRESSGZ=(pigz -c -f -n)
And you can choose the preferred method for package compression. For example,
Or turn off compression completely (fastest)