# 使用 Homebrew, apt, apk, chocolatey, dnf, Nix, pacman, zypper, scoop, winget 安装 gnu-which

查看 gnu-which 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

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

  证据: local Homebrew formula metadata

### Linux

- Debian apt (92%):

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

  证据: 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
```

  证据: 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
```

  证据: 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
```

  证据: 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
```

  证据: 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
```

  证据: 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
```

  证据: 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
```

  证据: 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
```

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

## 软件包事实

- **软件包键:** brew:gnu-which
- **软件包管理器:** Homebrew
- **版本:** 2.25
- **来源摘要:** GNU implementation of which utility
- **主页:** <https://savannah.gnu.org/projects/which/>
- **最后更新:** 2026-05-23T14:07:00-04:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- which (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 2.25
## 项目历史与用法

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.

### 项目历史

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.

### 采用历史

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.

### 使用方式

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.

### 为什么软件包爱好者会关心

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.

### 时间线

- 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.

### 来源

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


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- 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)


## 来源

- 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
