EXPAC(1)

πŸ“¦ version 10, in arch rolling

✨ EXPAC(1) ✨ β€” the expac manual πŸ’–

πŸŽ€ NAME πŸŽ€

expac β€” alpm data extraction utility

πŸ¦‹ SYNOPSIS πŸ¦‹

Usage: expac [options] <format> targets...

🌸 DESCRIPTION 🌸

okay so expac is a data extraction tool for alpm databases, and it's literally giving printf-like flexibility ✨. It's meant to be a simple tool for other pacman based utilities that don't link against the library. It uses pacman.conf as a config file for locating and loading your local and sync databases.

When you invoke expac, you supply a format string β€” usually one to many of the formatting tokens (peep the FORMATTING section πŸ’…) β€” plus any relevant options and zero to many targets. The format string has to be the first non-option argument. Targets can be a simple package name, a query string (in the case of a search), or repo/package syntax when the -sync option is supplied. Obsessed.

πŸ’… OPTIONS πŸ’…

  • -Q, --query β€” search the local database for provided targets. This is the default behavior.
  • -S, --sync β€” search the sync databases for provided targets.
  • -s, --search β€” search for packages matching the strings specified by targets. This is a boolean AND query and regex is allowed.
  • -g, --group β€” return packages matching the specified targets as package groups.
  • --config <file> β€” read from file for alpm initialization instead of /etc/pacman.conf.
  • -H, --humansize <size> β€” format package sizes in SI units according to size. Valid options are: B, K, M, G, T, P, E, Z, Y.
  • -1, --readone β€” stop searching after the first result. This only has an effect on -S operations without -s.
  • -d, --delim <string> β€” separate each package with the specified string. The default value is a newline character.
  • -l, --listdelim <string> β€” separate each list item with the specified string. Lists are any interpreted sequence specified with a capital letter. The default value is two spaces.
  • -p, --file β€” interpret targets as paths to local files.
  • -t, --timefmt <format> β€” output time described by the specified format. This string is passed directly to strftime(3). The default format is %c.
  • -v, --verbose β€” output more. Package not found errors will be shown, and empty field values will display as 'None'.
  • -V, --version β€” display version information and quit.
  • -h, --help β€” display the help message and quit.

🌈 FORMATTING 🌈

The format argument allows the following interpreted sequences, bestie:

  • %a β€” architecture
  • %B β€” backup files
  • %b β€” build date
  • %C β€” conflicts with (no version strings)
  • %D β€” depends on
  • %d β€” description
  • %E β€” depends on (no version strings)
  • %e β€” package base
  • %f β€” filename (only with -S)
  • %F β€” files (only with -Q)
  • %g β€” base64 encoded PGP signature (only with -S)
  • %G β€” groups
  • %H β€” conflicts with
  • %h β€” sha256sum
  • %i β€” has install scriptlet (only with -Q)
  • %k β€” download size (only with -S)
  • %l β€” install date (only with -Q)
  • %L β€” licenses
  • %m β€” install size
  • %M β€” modified backup files (only with -Q)
  • %n β€” package name
  • %N β€” required by
  • %O β€” optional deps
  • %o β€” optional deps (no descriptions)
  • %p β€” packager name
  • %P β€” provides
  • %R β€” replaces (no version strings)
  • %r β€” repo
  • %s β€” md5sum
  • %S β€” provides (no version strings)
  • %T β€” replaces
  • %u β€” project URL
  • %V β€” package validation method
  • %v β€” version
  • %w β€” install reason (only with -Q)
  • %! β€” result number (auto-incremented counter, starts at 0)
  • %% β€” literal %

quick lil' note: for any lowercase tokens aside from %m and %k, full printf support is allowed, e.g. %-20n. This does not apply to any list based, date, or numerical output.

Standard backslash escape sequences are supported, as per printf(1).

⭐ EXAMPLES ⭐

Emulate pacman's search function:

$ expac -Ss '%r/%n %v\n    %d' <search terms>

List the oldest 10 installed packages (by build date):

$ expac --timefmt=%s '%b\t%n' | sort -n | head -10

πŸ‘‘ AUTHOR πŸ‘‘

Dave Reisner <d@falconindy.com>


later bestie!! this iconic manual is expac 10, dated 2026-08-10 πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from