Skip to main content
The pacman module manages packages on Arch Linux systems using the pacman package manager.

Functions

packages

Install or remove pacman packages.
str | list[str]
List of packages to ensure.
bool
default:true
Whether the packages should be installed.
bool
default:false
Run pacman -Sy before installing packages.
bool
default:false
Run pacman -Su before installing packages.
Package versions can be pinned like pacman: <pkg>=<version>

Example


update

Update pacman package database.
This operation is not idempotent - it will always execute.

upgrade

Upgrade all pacman packages.
This operation is not idempotent - it will always execute.

Common Use Cases

System Setup

Full System Upgrade

Development Environment

Web Server Setup

Desktop Environment

Arch-Specific Tips

Pacman supports package groups which install multiple related packages:
For AUR (Arch User Repository) packages, you’ll need to use a helper like yay or paru:
Clean up old packages from cache:
Remove packages that were installed as dependencies but are no longer needed:

Important Notes

Always run pacman -Sy (update) before installing packages to ensure you’re installing the latest versions and avoid partial upgrades.
Pacman uses the --noconfirm flag in pyinfra operations to enable non-interactive installations.