$linuxjunkies
>

pacman(8)

pacman is the package manager for Arch Linux and Arch-based distributions, handling installation, removal, and updates of software packages.

UbuntuDebianFedoraArch

Synopsis

pacman [OPTION] [PACKAGE] ...

Description

pacman manages software packages using a rolling-release model with a simple dependency resolver. It maintains a local database of installed packages and can sync with remote repositories to fetch, build, and install software.

pacman operations are specified by one primary flag (-S, -R, -Q, -U, or -F) combined with modifiers. It uses tar.zst compressed archives and can handle both binary packages and source builds through the ABS (Arch Build System).

Common options

FlagWhat it does
-S, --syncSync packages from repositories; install, upgrade, or search for packages
-R, --removeRemove packages and dependencies from the system
-Q, --queryQuery the local database for installed packages and package information
-U, --upgradeInstall or upgrade local package files
-F, --filesQuery the file database; find which package owns a file
-u, --sysupgradeUpgrade all installed packages to newer versions
-s, --searchSearch package names and descriptions in repositories or local database
-i, --infoDisplay package information (dependencies, size, install date)
-y, --refreshDownload fresh package lists from all configured repositories
--noconfirmAssume yes to all prompts; skip confirmation dialogs
-w, --downloadonlyDownload packages without installing them
-c, --cascadeRemove packages and all packages that depend on them (with -R)

Examples

Install the firefox package from the repositories

pacman -S firefox

Refresh package lists and upgrade all installed packages to latest versions

pacman -Syu

List all installed packages and filter for those matching 'vim'

pacman -Q | grep vim

Search the repositories for packages matching 'base-devel'

pacman -Ss base-devel

Remove the vlc package from the system

pacman -R vlc

List only explicitly installed packages (not dependencies)

pacman -Qe

Find which package provides the /usr/bin/python file

pacman -F /usr/bin/python

Install a local package file from the current directory

pacman -U ./my-package-1.0-1-x86_64.pkg.tar.zst

Related commands