pkgfile is a tool for searching files from packages in the official repositories.
The pkgfile database can then be synced with:
# pkgfile -u
To search for a package that owns the file
$ pkgfile makepkg
To list all files provided by:
$ pkgfile -l archlinux-keyring
core/archlinux-keyring usr/ core/archlinux-keyring usr/share/ core/archlinux-keyring usr/share/pacman/ core/archlinux-keyring usr/share/pacman/keyrings/ core/archlinux-keyring usr/share/pacman/keyrings/archlinux-revoked core/archlinux-keyring usr/share/pacman/keyrings/archlinux-trusted core/archlinux-keyring usr/share/pacman/keyrings/archlinux.gpg
Latter is comparable to
pacman -Ql (see pacman#Querying package databases), except it applies to remote packages.
Command not found
abiword may be found in the following packages: extra/abiword 2.8.6-7 usr/bin/abiword
To enable it in all children shells, you need to source the hook from one of your shell initialization files.
Fish provides its own "command not found" hook for : Add command-not-found handler for Arch Linux #1925
By default, pkgfile will be updated daily. To change this schedule, edit the unit file.