expac
Query and extract package information from pacman
TLDR
List the dependencies of a package
List the optional dependencies of a package
List the download size of packages in MiB
List packages marked for upgrade with their download size
List explicitly-installed packages with their optional dependencies
SYNOPSIS
expac [options] [FORMAT]
PARAMETERS
-b, --brief
Suppress headers and footers for clean output.
-G
Query sync database package groups.
-H
Query the local package file repository.
-m NUM, --max=NUM
Limit results to at most NUM packages.
-Q, --qinstalled
Query locally installed packages.
-S
Query sync (remote) databases (default).
-h, --help
Display usage help.
-V, --version
Print version information.
DESCRIPTION
expac is a lightweight C tool for querying Arch Linux package databases via libalpm. It extracts package metadata and formats output using printf(1)-style strings, enabling custom reports on names, sizes, versions, dependencies, and more.
Default behavior queries sync repositories for available packages. Use -Q for installed packages, -G for groups, or -H for the local file repository. Examples: expac '%m %n' lists install sizes and names; expac -Q -m10 '%m %n' shows the 10 largest installed packages.
Ideal for scripting, disk usage analysis, dependency audits, and generating package lists. Faster than pacman -Qi for bulk queries, with no forking. Supports sorting via pipes to sort(1). Essential for Arch users managing systems or creating custom tools.
CAVEATS
Arch Linux/pacman-specific; requires libalpm. Invalid FORMAT specifiers cause errors. Large queries without -m may produce excessive output or high memory use.
KEY FORMAT SPECIFIERS
%n: name
%V: version
%D: description
%m: disk size (human)
%d: download size
%U: URL
%c: dependencies
%p: provides
%g: group. See man expac for full list with modifiers.
HISTORY
Developed by Andreas Henriksson in 2010; initially AUR, now in Arch extra repository. Uses libalpm for efficient access; actively maintained for pacman compatibility.


