LinuxCommandLibrary

expac

pacman database query tool with custom formatting

TLDR

List dependencies of a package

$ expac [-S|--sync] '%D' [package]
copy
List optional dependencies
$ expac [-S|--sync] "%o" [package]
copy
List download size of packages in MiB
$ expac [-S|--sync] [-H|--humansize] M '%k\t%n' [package1] [package2]
copy
List packages marked for upgrade with size
$ expac [-S|--sync] [-H|--humansize] M '%k\t%n' $(pacman -Qqu) | sort [-sh|--sort --human-numeric-sort]
copy
List explicitly-installed packages with optional dependencies
$ expac [-d|--delim] '\n\n' [-l|--listdelim] '\n\t' [-Q|--query] '%n\n\t%O' $(pacman -Qeq)
copy

SYNOPSIS

expac [options] format [targets]

DESCRIPTION

expac extracts data from alpm databases using printf-like format strings. It provides flexible output formatting for pacman-based package queries.
The tool acts as a lightweight alternative to parsing pacman output, offering direct access to package metadata including dependencies, sizes, descriptions, and installation dates. Format specifiers like %n (name), %v (version), %D (dependencies) enable custom reports.
Useful for scripting, package analysis, and generating custom package reports. Particularly powerful when combined with other tools for filtering and processing package information.

PARAMETERS

-S, --sync

Query sync database
-Q, --query
Query local database
-H, --humansize unit
Human-readable sizes (K, M, G)
-d, --delim string
Delimiter between packages
-l, --listdelim string
Delimiter for list items

CAVEATS

Arch Linux and derivatives only. Format strings use % specifiers. Part of the pacman ecosystem.

SEE ALSO

pacman(8), pactree(8)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community