# Install gnu-which with Homebrew, apt, apk, chocolatey, dnf, Nix, pacman, zypper, scoop, winget

GNU implementation of which utility. Version 2.25 via Homebrew; verified 2026-05-23. Also installable with debian: sudo apt install gnu-which.

## Install

```sh
sudo av install brew:gnu-which
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install gnu-which
```

  Evidence: local Homebrew formula metadata

### Linux

- Debian apt (92%):

```sh
sudo apt install gnu-which
```

  Evidence: Debian stable package indexes: gnu-which from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- apk (92%):

```sh
sudo apk add which
```

  Evidence: Alpine Linux edge package indexes: which from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- dnf (92%):

```sh
sudo dnf install which
```

  Evidence: Fedora Rawhide package metadata: which from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#which
```

  Evidence: nixpkgs package indexes: pkgs/by-name/wh/which/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S which
```

  Evidence: Arch Linux sync databases: which from https://geo.mirror.pkgbuild.com/core/os/x86_64/core.db.tar.gz

- zypper (92%):

```sh
sudo zypper install which
```

  Evidence: openSUSE Tumbleweed package metadata: which from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Chocolatey (92%):

```sh
choco install which
```

  Evidence: Chocolatey community package catalog: which from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','westwindwebsurge'

- Scoop (92%):

```sh
scoop install main/which
```

  Evidence: Scoop official bucket manifest trees: bucket/which.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id GnuWin32.Which -e
```

  Evidence: Windows Package Manager source index: GnuWin32.Which from https://cdn.winget.microsoft.com/cache/source.msix

## Package facts

- **Package key:** brew:gnu-which
- **Package manager:** Homebrew
- **Version:** 2.25
- **Source summary:** GNU implementation of which utility
- **Homepage:** <https://savannah.gnu.org/projects/which/>
- **Last updated:** 2026-05-23T14:07:00-04:00
- **Generated:** 2026-08-03T19:37:03+00:00

## Executables

- which (alias)

## Install behavior

- Bottle: not available

## Freshness

- Page generated: 2026-08-03
- Package-manager version: 2.25
## Project history and usage

GNU Which is the GNU implementation of the which utility, a small command that reports which executable a shell would find for a command name. Its domain is intentionally narrow: inspect command search paths and explain why a name resolves to one program rather than another.

### Project history

The official Savannah project page is the package home, and the GNU FTP archive records public releases from which 2.16 and 2.17 in 2007 through later 2.x releases. After version 2.21 in 2015, GNU FTP shows renewed releases in the 2.22, 2.23, and 2.25 line during 2025 and 2026.

### Adoption history

The utility is widely familiar because shells, Unix variants, and GNU systems all have command lookup workflows. GNU Which remains separately packaged for environments where users want GNU behavior, GNU licensing, or an external executable rather than a shell builtin or shell-specific type command.

### How it is used

Practitioners use which when debugging PATH order, checking whether a package installed the expected executable, documenting build prerequisites, or explaining why scripts pick one compiler, interpreter, or helper over another.

### Why package nerds care

The significance is mostly operational: it is a tiny diagnostic tool for path hygiene. In package-manager culture, which helps confirm shims, keg-only tools, alternatives systems, and GNU-prefixed replacements without reading shell startup files by hand.

### Timeline

- 2007: GNU FTP archive lists which 2.16 and 2.17.
- 2015: GNU FTP archive lists which 2.21.
- 2025: GNU FTP archive lists which 2.22 and 2.23.
- 2026: GNU FTP archive lists which 2.25.

### Related projects

- Related tools include shell builtins such as command -v and type, POSIX shell command lookup, alternatives systems, and package-manager shim directories.

### Sources

- <https://formulae.brew.sh/formula/gnu-which>
- <https://ftp.gnu.org/gnu/which/>
- <https://savannah.gnu.org/projects/which>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Other Package-Manager Records

- Debian apt - gnu-which - 2.21+dfsg-5: normalized package name match | Debian stable package indexes: gnu-which from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Utility to show the full path of commands | https://savannah.gnu.org/projects/which
- Ubuntu apt - gnu-which - 2.21+dfsg-4build1: normalized package name match | Ubuntu 24.04 LTS package indexes: gnu-which from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Utility to show the full path of commands | https://savannah.gnu.org/projects/which
- Nix - which: installed executable or alias match | nixpkgs package indexes: pkgs/by-name/wh/which/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - which - 2.25-r0: installed executable or alias match | Alpine Linux edge package indexes: which from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A utility to show the full path of commands | https://savannah.gnu.org/projects/which
- apk - which-doc - 2.25-r0: installed executable or alias match | Alpine Linux edge package indexes: which-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A utility to show the full path of commands (documentation) | https://savannah.gnu.org/projects/which
- dnf - which - 2.25-2.fc45: installed executable or alias match | Fedora Rawhide package metadata: which from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Displays where a particular program in your path is located | https://savannah.gnu.org/projects/which/
- pacman - which - 2.25-1: installed executable or alias match | Arch Linux sync databases: which from https://geo.mirror.pkgbuild.com/core/os/x86_64/core.db.tar.gz | A utility to show the full path of commands | https://savannah.gnu.org/projects/which/
- zypper - which - 2.25-1.3: installed executable or alias match | openSUSE Tumbleweed package metadata: which from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Displays where a particular program in your path is located | https://savannah.gnu.org/projects/which/
- Chocolatey - which: installed executable or alias match | Chocolatey community package catalog: which from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','westwindwebsurge'
- Scoop - main/which: installed executable or alias match | Scoop official bucket manifest trees: bucket/which.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - GnuWin32.Which: installed executable or alias match | Windows Package Manager source index: GnuWin32.Which from https://cdn.winget.microsoft.com/cache/source.msix
- winget - allankoechke.which: installed executable or alias match | Windows Package Manager source index: allankoechke.which from https://cdn.winget.microsoft.com/cache/source.msix


## Combined YAML source

View the package source record on GitHub. [combined/gnu-which.yml](https://github.com/mxcl/pkgdb/blob/main/combined/gnu-which.yml)


## Sources

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
