You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This kind of feature can be used to suggest package installation when executing a missing binary, like so (for zsh):
command_not_found_handler() {
pkgs=($(pkgfile -b -- "$1"))
if [[ -n"$pkgs" ]] ;thenecho"Command not found but package found!">&2echo"Installing ${pkgs[1]}\n">&2
sudo pacman -S ${pkgs[1]}>&2echo"\nExecuting $@">&2"$@"return$?elseecho"Command or package not found: $1">&2return 127
fi
}
$ wget
zsh: correct wget to _wget [nyae]? n
Command not found but package found!
Installing extra/wget
resolving dependencies...
looking for conflicting packages...
Packages (1) wget-1.20.3-2
Total Installed Size: 2.88 MiB
:: Proceed with installation? [Y/n]
[...]
Executing wget
wget: missing URL
Usage: wget [OPTION]... [URL]...
Try `wget --help' for more options.
The text was updated successfully, but these errors were encountered:
@jody-frankowski That feature is great for pacman, but I am not sure it's supported on other distribution. What distro/OS you're using with pacapt now? Thanks
Any news on this ?
I'm really interested in this feature: would be useful inside the BASH command_not_found_handle() function, to automatically search for the package(s) providing the executable that wasn't found.
A nice feature that's missing is the support for
pacman -F
/pkgfile
https://wiki.archlinux.org/index.php/Pacman#Search_for_a_package_that_contains_a_specific_file https://wiki.archlinux.org/index.php/Pkgfile.This kind of feature can be used to suggest package installation when executing a missing binary, like so (for zsh):
The text was updated successfully, but these errors were encountered: