# Install gperf with Homebrew, apk, chocolatey, apt, dnf, MacPorts, Nix, pacman, winget, zypper

Perfect hash function generator. Version 3.3 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:gperf
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install gperf
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install gperf
```

  Evidence: MacPorts ports tree: devel/gperf/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add gperf
```

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

- Debian apt (92%):

```sh
sudo apt install gperf
```

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

- dnf (92%):

```sh
sudo dnf install gperf
```

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

- Nix (92%):

```sh
nix profile install nixpkgs#gperf
```

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

- pacman (92%):

```sh
sudo pacman -S gperf
```

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

- zypper (92%):

```sh
sudo zypper install gperf
```

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

### Windows

- Chocolatey (92%):

```sh
choco install gperf
```

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

- winget (92%):

```sh
winget install --id oss-winget.gperf -e
```

  Evidence: Windows Package Manager source index: oss-winget.gperf from https://cdn.winget.microsoft.com/cache/source.msix

## Package facts

- **Package key:** brew:gperf
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/gperf>
- **Version:** 3.3
- **Source summary:** Perfect hash function generator
- **Homepage:** <https://www.gnu.org/software/gperf/>
- **Repository:** <https://git.savannah.gnu.org/cgit/gperf.git>
- **Upstream docs:** <https://www.gnu.org/software/gperf>
- **License:** GPL-3.0-or-later
- **Source archive:** <https://ftpmirror.gnu.org/gnu/gperf/gperf-3.3.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- gperf (cli)
- gperf (alias)

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 3.3
- Local data: ok
- Upstream repository: https://www.gnu.org/software/gperf/
- info: No package-manager update timestamp was available.
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

GNU gperf is the GNU perfect hash function generator: it reads a static set of keywords and emits C or C++ lookup code designed for collision-free recognition with one string comparison.

### Project history

The GNU manual says the gperf utility was written in GNU C++ by Douglas C. Schmidt, with the general idea inspired by Keith Bostic's C algorithm distributed to net.sources around 1984. The manual frames the GNU program as a heavily modified, enhanced, and extended implementation created at the University of California, Irvine.

gperf belongs to the classic Unix compiler-tool family. Its input format resembles tools such as lex in using declarations and `%%` separators, while its output is ordinary C or C++ source that can be checked into or generated during builds.

### Adoption history

GNU documents gperf as useful for static search sets such as compiler reserved words, assembler instruction opcodes, and shell built-ins. That made it attractive in source-based packaging ecosystems because generated lookup tables can be fast, deterministic, and dependency-light.

The GNU project page distributes gperf through the GNU FTP mirror network and points development to the Savannah project, placing it in the same distribution pattern as many older GNU build-time utilities. Homebrew, Debian, Ubuntu, Fedora, Arch, Nix, MacPorts, Chocolatey, and other package systems carry packages for it in the input metadata, reflecting its role as a small but widely available build dependency.

### How it is used

A user supplies a keyword file, optionally including struct declarations and gperf declarations, and gperf writes generated lookup code. The GNU page describes options for C or C++ output, switch statements or nested if statements instead of a hash table, and algorithm tuning.

Typical use is not interactive end-user work but build-time code generation. Projects use it when a fixed vocabulary needs fast membership tests without maintaining handwritten hash tables.

### Why package nerds care

Package maintainers care about gperf because it often appears as a small build requirement that is easy to miss when bootstrapping language runtimes, compilers, and parser-heavy tools. It is old, tiny, and boring in the good way: a generated C file is easier to ship than a runtime dependency.

It also illustrates a packaging distinction between generated artifacts and generators. Some upstreams ship generated source, while others require gperf at build time, so package recipes need to know whether gperf is a native build tool or merely an optional maintainer tool.

### Timeline

- 1984: Keith Bostic's C perfect-hash algorithm circulated on net.sources, later cited by the GNU manual as an inspiration.
- Late 1980s: Douglas C. Schmidt developed the GNU C++ implementation at the University of California, Irvine.
- 1998-2025: The GNU project page records long-running FSF maintenance of the gperf web page and GNU mirror distribution.
- 3.x series: gperf continued as a GPL-3-or-later GNU utility with C and C++ code-generation support documented in the GNU manual.

### Related projects

- Related GNU and Unix build tools include flex, bison, GNU indent, compiler front ends, and parser or lexer generators that also turn compact declarative inputs into C-family source.
- The manual specifically discusses static sets such as C reserved words, assembler opcodes, and shell built-ins as natural problem domains for gperf.

### Sources

- <https://git.savannah.gnu.org/cgit/gperf.git>
- <https://www.gnu.org/software/gperf/>
- <https://www.gnu.org/software/gperf/manual/gperf.html>


## Security Notes

narrow executable package without higher-risk signals.

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

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** gperf
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## Other Package-Manager Records

- Debian apt - gperf - 3.2.1-1: normalized package name match | Debian stable package indexes: gperf from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Perfect hash function generator | http://www.gnu.org/software/gperf/
- Nix - gperf: normalized package name match | nixpkgs package indexes: pkgs/by-name/gp/gperf/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - gperf - 3.1-1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: gperf from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Perfect hash function generator | http://www.gnu.org/software/gperf/
- apk - gperf - 3.3-r0: normalized package name match | Alpine Linux edge package indexes: gperf from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Perfect hash function generator. | https://www.gnu.org/software/gperf/
- apk - gperf-doc - 3.3-r0: normalized package name match | Alpine Linux edge package indexes: gperf-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Perfect hash function generator. (documentation) | https://www.gnu.org/software/gperf/
- dnf - gperf - 3.2.1-3.fc44: normalized package name match | Fedora Rawhide package metadata: gperf from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | A perfect hash function generator | http://www.gnu.org/software/gperf/
- pacman - gperf - 3.3-2: normalized package name match | Arch Linux sync databases: gperf from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Perfect hash function generator | https://www.gnu.org/software/gperf/
- zypper - gperf - 3.3-1.3: normalized package name match | openSUSE Tumbleweed package metadata: gperf from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | A Compiler Tool for Generating Perfect Hash Functions | https://gnu.org/software/gperf/
- MacPorts - gperf: normalized package name match | MacPorts ports tree: devel/gperf/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Chocolatey - gperf: normalized package name match | Chocolatey community package catalog: gperf from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','glab'
- winget - oss-winget.gperf: normalized package name match | Windows Package Manager source index: oss-winget.gperf from https://cdn.winget.microsoft.com/cache/source.msix


## Related links

- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [autogen](https://www.automicvault.com/pkg/brew/autogen/) - Shares av.db curated category or tags: cli, code-generation, developer-tools, gnu.
- [cproto](https://www.automicvault.com/pkg/brew/cproto/) - Shares av.db curated category or tags: c, cli, code-generation, developer-tools.
- [crcany](https://www.automicvault.com/pkg/brew/crcany/) - Shares av.db curated category or tags: c, cli, code-generation, developer-tools.
- [gengetopt](https://www.automicvault.com/pkg/brew/gengetopt/) - Shares av.db curated category or tags: c, cli, code-generation, developer-tools.
- [treecc](https://www.automicvault.com/pkg/brew/treecc/) - Shares av.db curated category or tags: cli, code-generation, developer-tools, gnu.
- [configen](https://www.automicvault.com/pkg/brew/configen/) - Shares av.db curated category or tags: cli, code-generation, developer-tools.
- [counterfeiter](https://www.automicvault.com/pkg/brew/counterfeiter/) - Shares av.db curated category or tags: cli, code-generation, developer-tools.
- [create-api](https://www.automicvault.com/pkg/brew/create-api/) - Shares av.db curated category or tags: cli, code-generation, developer-tools.
- [cflow](https://www.automicvault.com/pkg/brew/cflow/) - Local package facts share a topical domain. Shared terms: c, cli, code, developer, developer-tools.

## Combined YAML source

View the package source record on GitHub. [combined/gperf.yml](https://github.com/automic-vault/db/blob/main/combined/gperf.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
