Skip to content

Repository files navigation

findpkg

A fast command not found handler for pacman. It suggests which package to install when you try to run a command from a package that isn't installed

$ tree
tree may be found in the following packages:
extra/tree /usr/bin/tree

The output is more or less the same as pkgfile's hook but is substantially faster. pkgfile can take several seconds to complete, which is easily confused for a successful command invocation

HookCold cacheWarm cache
findpkg40ms1.4ms
pkgfile1874ms440ms

Installation

Install findpkg from the AUR

yay -S findpkg

Create/update the database

sudo pkgfile --update

Enable automatic database updates (Optional)

systemctl enable pkgfile.timer

Bash

Add the following to ~/.bashrc

command_not_found_handle() {
findpkg "$1"
}

fish

Run:

function fish_command_not_found
findpkg $argv[1]
endfuncsave fish_command_not_found

Zsh

Add the following to ~/.zshrc

command_not_found_handler() {
findpkg "$1"
}

About

A fast command not found handler for Pacman

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages