PKGFILE(1)

πŸ“¦ version 27, in arch rolling

πŸ‘‘ PKGFILE(1) β€” the pkgfile manual, but make it make sense πŸ’…

okay so bestie, welcome to PKGFILE(1), aka the pkgfile manual page. it's an alpm .files metadata explorer and honestly? it's that girl. let's get into it πŸ’–


✨ NAME ✨

pkgfile β€” an alpm .files metadata explorer πŸ¦‹


✨ SYNOPSIS ✨

Usage: pkgfile [operation] [options] target

✨ DESCRIPTION ✨

so like, pkgfile goes digging through the .files metadata that repo-add(8) created, to pull up file info about packages πŸ”. by default it treats whatever target you handed it as a filename, and gives you back the package(s) that contain that file. and which repos does it search? the ones you've enabled in /etc/pacman.conf, periodt πŸ’…


✨ OPERATIONS ✨

  • -l, --list β€” now the target is treated as a package name instead of a filename, and you get the contents of that package back πŸŽ€. this one lets you use repo/package style syntax (like "core/pacman") to narrow the search β€” but only when --list is used without the --glob or --regex options, iykyk.
  • -s, --search β€” searches for packages containing the target you gave it. this is the default mode, the main character of operations fr fr πŸ‘‘.
  • -u, --update β€” updates the stored metadata files. highly recommend setting up a daily cron job with this command so your results stay accurate πŸ’―. by default it only downloads repos that are found to be newer on the mirror β€” pass this option twice to force all repos to be downloaded. no cap.

✨ MATCHING ✨

  • -b, --binaries β€” returns only files that live inside a bin or sbin directory 🧚
  • -d, --directories β€” also includes directories in the search results, because directories deserve love too 🫢
  • -g, --glob β€” turns on shell-style glob pattern matching. see glob(7). heads up tho: the shell wildcards * and ? will never match path separators πŸ™ˆ. so this kind of matching is your go-to for searching entries within directories, like /usr/bin/*.
  • -i, --ignorecase β€” disables case sensitivity in matching. case? never heard of her ✨
  • -r, --regex β€” turns on regular expression matching. see pcre(3).
  • -R REPO, --repo=REPO β€” searches only that specific repo. one repo, only vibes 🎯

✨ OUTPUT ✨

  • -0, --null β€” delimits output with null bytes instead of newline characters.
  • -q, --quiet β€” outputs less. this one applies to the --list operation.
  • -v, --verbose β€” outputs more. this one applies to the --search operation.
  • -w, --raw β€” avoids justification of the 2 column output. raw and unfiltered, just how we like it πŸ’€

✨ GENERAL OPTIONS ✨

  • -C FILE, --config=FILE β€” use a config file other than the default of /etc/pacman.conf.
  • -D DIRECTORY, --cachedir=DIRECTORY β€” use a cache path other than the compile-time default.
  • -h, --help β€” prints help and exits. classic πŸŽ€
  • -V, --version β€” prints the version and exits.

✨ MATCHING HEURISTICS ✨

okay so in --search mode, and without the --regex or --glob option, pkgfile will try to match your target as an exact filename. and if the target contains a / character, it'll attempt a full path match instead πŸ”₯. but with --regex and --glob enabled searching, pkgfile will always match against the full pathname. that's the rule, that's the vibe check.

in --list mode, and without the --regex or --glob option, pkgfile will try to match your target as an exact package name. and if the target contains a / character, the text before the slash gets assumed to be a repository, and the search gets restricted accordingly 🌸


✨ COMMAND NOT FOUND HOOKS ✨

/usr/share/doc/pkgfile/command-not-found.bash
/usr/share/doc/pkgfile/command-not-found.zsh
/usr/share/doc/pkgfile/command-not-found.fish

these are zsh, bash and fish compatible functions that you can drop into your shell initialization so pkgfile runs whenever an executed command isn't found 😭 β€” like, the terminal literally goes "idk her" and pkgfile swoops in.

if the environment variable PKGFILE_PROMPT_INSTALL_MISSING is set, and only one package is found, you'll get a prompt to install that package 🫢. NOTE: this feature requires the sudo(8) program, and is currently only supported by the bash and zsh implementations. the fish girlies will have to wait 🐟


✨ AUTOMATING UPDATES ✨

it is recommended that you use pkgfiled(1) to keep the .files DBs up as pacman -Fy is issued (either by a user or a cronjob/systemd timer). you can enable pkgfiled with:

systemctl enable --now pkgfiled

alternatively, pkgfile includes systemd timer and service units to automate periodic updates to the .files DBs ⏰. assuming pkgfile was built with systemd support, you can enable that with:

systemctl enable --now pkgfile-update.timer

slay, your DBs are now self-sufficient πŸ’…βœ¨


✨ SEE ALSO ✨

pkgfiled(1), repo-add(8), pcre(3), glob(7), pacman.conf(5)


✨ AUTHOR ✨

Dave Reisner <d@falconindy.com> β€” king behavior πŸ‘‘


and that's the whole page bestie, no skips, no cuts πŸ’–

kisses and goodbye from pkgfile 27, dated 2026-10-24 β€” that's the version and the date, signed, sealed, delivered, mwah πŸŽ€πŸ’‹

πŸ“¦ where this page comes from