LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pkgfile

Search Arch repositories for file ownership

TLDR

Synchronize pkgfile database
$ sudo pkgfile --update
copy
Search for package owning a file
$ pkgfile [filename]
copy
List files provided by a package
$ pkgfile --list [package]
copy
List executables in a package
$ pkgfile --list --binaries [package]
copy
Case-insensitive search
$ pkgfile --ignorecase [filename]
copy
Search in bin/sbin directories only
$ pkgfile --binaries [filename]
copy
Search with version display
$ pkgfile --verbose [filename]
copy
Search in a specific repository
$ pkgfile --repo [core] [filename]
copy

SYNOPSIS

pkgfile [--update] [--list] [--binaries] [--verbose] [--repo repo] target

DESCRIPTION

pkgfile searches for packages in the official Arch Linux repositories that contain a specific file. It maintains its own database of file-to-package mappings for fast lookups.The tool is commonly used to find which package provides a missing command or file. It can also list all files a package contains, useful for understanding package contents before installation.

PARAMETERS

-u, --update

Synchronize pkgfile database
-l, --list
List files in package
-b, --binaries
Only search/list executables
-i, --ignorecase
Case-insensitive matching
-v, --verbose
Show package version
-R, --repo repo
Search specific repository
-g, --glob
Enable shell-style glob pattern matching
-r, --regex
Enable regular expression matching
-d, --directories
Include directories in search results
-q, --quiet
Suppress error messages
-0, --null
Delimit output with null bytes

CAVEATS

Database must be synchronized before use. Only searches official repositories, not AUR. Database updates require root privileges. Large database may take time to download initially.

HISTORY

pkgfile was created for Arch Linux to provide fast file-to-package lookups. It offers similar functionality to `pacman -F` but with a dedicated database optimized for this purpose.

SEE ALSO

pacman(8), pactree(1), makepkg(8)

Copied to clipboard
Kai