Contents

Pacman package management

Managing pacman packages in Arch Linux and its derivatives (Manjaro, enOS).

Generating a list of packages

List non-AUR, explicitly installed packages:

1
pacman -Qnqe > pkgs.txt

List AUR packages:

1
pacman -Qqem > aurpkgs.txt

List all explicitly installed packages:

1
pacman -Qqe > allpkgs.txt

Install packages from a list

1
2
paru  # Full upgrade the system first
paru -S --needed - < pkgs.txt

Compilation options for AUR packages

To customize compilation options, a good starting point is to copy from the system-wide config file:

1
cp /etc/makepkg.conf ~/.makepkg.conf

to you own ~/.makepkg.conf makepkg@ArchWiki. However, PKGBUILD settings still have higher priority.

CPU target for building optimized binaries

1
2
3
CFLAGS="-march=native -O2 -pipe -fstack-protector-strong -fno-plt"
CXXFLAGS="${CFLAGS}"
RUSTFLAGS="-C opt-level=2 -C target-cpu=native"

Parallel compilation

1
MAKEFLAGS="-j$(nproc)"

Compressing packages

1
2
3
4
5
6
7
8
# 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

e.g.

1
PKGEXT='.pkg.tar.zst'

Or turn off compression completely (fastest) x

1
PKGEXT='.pkg.tar'