pacman -S --noconfirm: Packages on Arch Linux
pacman -S --noconfirm installs packages on Arch Linux without asking for confirmation.
Arch CI images use pacman. Because Arch is rolling-release, you usually sync the database first, and --noconfirm keeps the install unattended.
What it does
pacman -S synchronizes and installs the named packages from the repositories. --noconfirm answers all prompts with the default, and --needed skips reinstalling packages already at the target version. -y refreshes the package database.
Common usage
pacman -Sy --noconfirm archlinux-keyring # refresh keyring first
pacman -S --noconfirm --needed git curl ca-certificates
# clean the package cache to shrink images
pacman -Scc --noconfirmOptions
| Flag | What it does |
|---|---|
| -S <pkg> | Sync and install a package |
| --noconfirm | Do not prompt for confirmation |
| --needed | Skip packages already up to date |
| -y | Refresh the package database |
| -yy | Force a full database refresh |
| -Scc | Remove all cached packages and databases |
In CI
On Arch containers the signing keyring can be stale; run pacman -Sy --noconfirm archlinux-keyring before installing to avoid signature errors. Do not run a bare pacman -Sy without following it with an install, since a partial upgrade can break the system.
Common errors in CI
"error: target not found: <pkg>" means the name is wrong or the database is stale; refresh with -Sy. "error: <pkg>: signature from ... is unknown trust" or "invalid or corrupted package (PGP signature)" means the keyring is outdated; update archlinux-keyring. "failed to synchronize all databases ... unable to lock database" means /var/lib/pacman/db.lck exists from a prior run; remove it.