Difference between revisions of "Pkgfile"

From ArchWiki
Jump to: navigation, search
(finish example 2; make example 2 use 'archlinux-keyring' because it has little output)
(Updated "Command not found" - hook in regard of the splitting of pkgtools and pkgfile)
Line 22: Line 22:
 
  core/archlinux-keyring usr/share/pacman/keyrings/archlinux-trusted
 
  core/archlinux-keyring usr/share/pacman/keyrings/archlinux-trusted
 
  core/archlinux-keyring usr/share/pacman/keyrings/archlinux.gpg
 
  core/archlinux-keyring usr/share/pacman/keyrings/archlinux.gpg
 +
 +
=="Command not found" - hook==
 +
To make pkgfile automatically print the package you want to install to make some command available, include the following line in {{ic|~/.bashrc}} or {{ic|/etc/bash.bashrc}}:
 +
source /usr/share/doc/pkgfile/command-not-found.bash

Revision as of 20:43, 22 July 2012

pkgfile is a tool that tells you which package owns a specified file or which files a given package provides.

You can install it with pkgfile from the official repositories or with pkgfile-gitAUR from the Arch User Repository.

After installing the package, you should update the file list database as root:

# pkgfile --update

Example:

$ pkgfile makepkg     # Search for a package that contains a file named 'makepkg'.
core/pacman           # Your searched file is in the 'pacman' package in the [core] repository.

Example 2:

$ pkgfile --list core/archlinux-keyring   # List all files provided by the 'archlinux-keyring' package in the [core] repository.
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

"Command not found" - hook

To make pkgfile automatically print the package you want to install to make some command available, include the following line in ~/.bashrc or /etc/bash.bashrc:

source /usr/share/doc/pkgfile/command-not-found.bash