LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pkgfile

Search Arch repositories for file ownership

TLDR

Refresh the file database, which is required before the first search
$ sudo pkgfile --update
copy
Find which package provides a file
$ pkgfile [/usr/bin/ss]
copy
Search only the executables in `bin` and `sbin`
$ pkgfile --binaries [ss]
copy
Match with a glob pattern
$ pkgfile --glob [*/libssl.so*]
copy
Match with a regular expression
$ pkgfile --regex [libc.*\.so]
copy
Ignore case while searching
$ pkgfile --ignorecase [readme]
copy
List everything a package installs
$ pkgfile --list [openssh]
copy
List only the executables a package installs
$ pkgfile --list --binaries [openssh]
copy
Restrict the search to one repository
$ pkgfile --repo [extra] [filename]
copy
Show the package version alongside each match
$ pkgfile --verbose [/usr/bin/ss]
copy
Print unformatted output for scripts
$ pkgfile --raw [/usr/bin/ss]
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

INSTALL

sudo pacman -S pkgfile
copy

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)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid