# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, zypper 安装 nghttp2

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

## 安装

```sh
sudo av install brew:nghttp2
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install nghttp2
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install nghttp2
```

  证据: MacPorts ports tree: www/nghttp2/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add nghttp2
```

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

- Debian apt (92%):

```sh
sudo apt install nghttp2
```

  证据: Debian stable package indexes: nghttp2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install nghttp2
```

  证据: Fedora Rawhide package metadata: nghttp2 from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#nghttp2
```

  证据: nixpkgs package indexes: pkgs/by-name/ng/nghttp2/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- zypper (92%):

```sh
sudo zypper install nghttp2
```

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

## 软件包事实

- **软件包键:** brew:nghttp2
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/nghttp2>
- **版本:** 1.70.0
- **来源摘要:** HTTP/2 C Library
- **主页:** <https://nghttp2.org/>
- **仓库:** <https://github.com/nghttp2/nghttp2>
- **上游文档:** <https://nghttp2.org/>
- **许可证:** MIT
- **源码归档:** <https://github.com/nghttp2/nghttp2/releases/download/v1.70.0/nghttp2-1.70.0.tar.gz>
- **最后更新:** 2026-08-01T13:15:08Z
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- h2load (cli)
- nghttp (cli)
- nghttpd (cli)
- nghttpx (cli)
- h2load (别名)
- nghttp (别名)
- nghttpd (别名)
- nghttpx (别名)

## 依赖

- c-ares
- jemalloc
- libev
- libnghttp2
- openssl@3

## 构建依赖

- pkgconf

## macOS 提供的库

- libxml2

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 1.70.0
- 管理器更新时间: 2026-08-01
- 本地数据: OK
- 上游仓库: https://github.com/nghttp2/nghttp2
- 信息: No cached GitHub release or tag data was available.
## 项目历史与用法

nghttp2 is a C implementation of HTTP/2's framing layer plus command-line tools: `nghttp` for client/frame inspection, `nghttpd` for a test server, `nghttpx` for proxying, and `h2load` for benchmarking. It also exposes HPACK encoding and decoding APIs.

### 项目历史

The project came out of the HTTP/2 standardization period. Its own documentation says the code base was forked from Tatsuhiro Tsujikawa's earlier spdylay project, a C implementation of Google's SPDY protocol, and was originally based on RFC 7540 and RFC 7541 before moving toward RFC 9113.

That origin explains the shape of the package: it is not only a library, but a lab bench for HTTP/2. The tools let implementers speak h2 or h2c directly, inspect frames, run a proxy, and stress-test servers while the library handles the binary framing details.

### 采用历史

nghttp2 became important because large projects did not want to hand-roll HTTP/2 framing. Apache httpd's documentation says `mod_http2` uses nghttp2 as its implementation base and requires libnghttp2 when building HTTP/2 support.

curl also made nghttp2 part of the mainstream HTTP/2 toolchain. curl's 7.43.0 changelog in June 2015 required nghttp2 1.0.0 or later for HTTP/2 multiplexing support, and everything curl documents HTTP/2 support for HTTP and HTTPS when curl is built with the needed prerequisites.

### 使用方式

Developers install nghttp2 directly when they need the command-line tools, or indirectly as a dependency for HTTP clients and servers. `nghttp` is useful for seeing HTTP/2 frames rather than just HTTP semantics, while `h2load` is a quick load generator for h2 endpoints.

Packagers care about nghttp2 because it is a protocol-library dependency with ABI and feature implications. A curl or Apache build with libnghttp2 available can expose HTTP/2 support; without it, the package may build but lose protocol behavior that users assume is present.

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

nghttp2 is the little C library behind a lot of HTTP/2 enablement. It is a classic packaging multiplier: small on its own, but it changes the capabilities of curl, Apache httpd, and other network stacks that link to it.

### 时间线

- 2012: Source files in the nghttp2 tree carry early copyright dates from Tatsuhiro Tsujikawa's implementation work.
- 2013: nghttp2 emerged from the spdylay/SPDY lineage during HTTP/2 standardization.
- 2015-06-17: curl 7.43.0 documented HTTP/2 multiplexing support requiring nghttp2 1.0.0 or later.
- 2015: Apache httpd 2.4 HTTP/2 support standardized around `mod_http2`, which uses libnghttp2 as its implementation base.

### Related projects

- spdylay
- HTTP/2
- HPACK
- curl
- Apache httpd mod_http2

### 来源

- <https://curl.se/changes.html>
- <https://everything.curl.dev/http/versions/http2.html>
- <https://formulae.brew.sh/formula/nghttp2>
- <https://github.com/nghttp2/nghttp2>
- <https://httpd.apache.org/docs/current/howto/http2.html>
- <https://nghttp2.org/documentation/package_README.html>


## 安全说明

broad file, network, media, or database tool signal.

- **Geiger 风险:** blue / 中
- broad file, network, media, or database tool signal

## 源数据库详情

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

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

- Debian apt - libnghttp2-14 - 1.64.0-1.1+deb13u1: normalized package name match | Debian stable package indexes: libnghttp2-14 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | library implementing HTTP/2 protocol (shared library) | https://nghttp2.org/
- Debian apt - libnghttp2-dev - 1.64.0-1.1+deb13u1: normalized package name match | Debian stable package indexes: libnghttp2-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | library implementing HTTP/2 protocol (development files) | https://nghttp2.org/
- Debian apt - libnghttp2-doc - 1.64.0-1.1+deb13u1: normalized package name match | Debian stable package indexes: libnghttp2-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | library implementing HTTP/2 protocol (documentation) | https://nghttp2.org/
- Debian apt - nghttp2 - 1.64.0-1.1+deb13u1: normalized package name match | Debian stable package indexes: nghttp2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | server, proxy and client implementing HTTP/2 | https://nghttp2.org/
- Debian apt - nghttp2-client - 1.64.0-1.1+deb13u1: normalized package name match | Debian stable package indexes: nghttp2-client from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | client implementing HTTP/2 protocol | https://nghttp2.org/
- Debian apt - nghttp2-proxy - 1.64.0-1.1+deb13u1: normalized package name match | Debian stable package indexes: nghttp2-proxy from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | reverse proxy implementing HTTP/2 protocol | https://nghttp2.org/
- Debian apt - nghttp2-server - 1.64.0-1.1+deb13u1: normalized package name match | Debian stable package indexes: nghttp2-server from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | server implementing HTTP/2 protocol | https://nghttp2.org/
- Nix - nghttp2: normalized package name match | nixpkgs package indexes: pkgs/by-name/ng/nghttp2/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libnghttp2-14 - 1.59.0-1build4: normalized package name match | Ubuntu 24.04 LTS package indexes: libnghttp2-14 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | library implementing HTTP/2 protocol (shared library) | https://nghttp2.org/
- Ubuntu apt - libnghttp2-dev - 1.59.0-1build4: normalized package name match | Ubuntu 24.04 LTS package indexes: libnghttp2-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | library implementing HTTP/2 protocol (development files) | https://nghttp2.org/
- Ubuntu apt - libnghttp2-doc - 1.59.0-1build4: normalized package name match | Ubuntu 24.04 LTS package indexes: libnghttp2-doc from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | library implementing HTTP/2 protocol (documentation) | https://nghttp2.org/
- Ubuntu apt - nghttp2 - 1.59.0-1build4: normalized package name match | Ubuntu 24.04 LTS package indexes: nghttp2 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | server, proxy and client implementing HTTP/2 | https://nghttp2.org/
- Ubuntu apt - nghttp2-client - 1.59.0-1build4: normalized package name match | Ubuntu 24.04 LTS package indexes: nghttp2-client from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | client implementing HTTP/2 protocol | https://nghttp2.org/
- Ubuntu apt - nghttp2-proxy - 1.59.0-1build4: normalized package name match | Ubuntu 24.04 LTS package indexes: nghttp2-proxy from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | reverse proxy implementing HTTP/2 protocol | https://nghttp2.org/
- Ubuntu apt - nghttp2-server - 1.59.0-1build4: normalized package name match | Ubuntu 24.04 LTS package indexes: nghttp2-server from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | server implementing HTTP/2 protocol | https://nghttp2.org/
- apk - nghttp2 - 1.70.0-r0: normalized package name match | Alpine Linux edge package indexes: nghttp2 from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | HTTP/2 C client, server and proxy | https://nghttp2.org


## 相关链接

- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Web development packages](https://pkg.so/zh-hans/web-dev-tools/) - Matched web development metadata.
- [openssl@3](https://pkg.so/zh-hans/brew/openssl-3/) - Runtime dependency declared by Homebrew.
- [c-ares](https://pkg.so/zh-hans/brew/c-ares/) - Runtime dependency declared by Homebrew.
- [jemalloc](https://pkg.so/zh-hans/brew/jemalloc/) - Runtime dependency declared by Homebrew.
- [pkgconf](https://pkg.so/zh-hans/brew/pkgconf/) - Build dependency declared by Homebrew.
- [proxygen](https://pkg.so/zh-hans/brew/proxygen/) - Shares pkgdb curated category or tags: cli, http, http2, networking.
- [neon](https://pkg.so/zh-hans/brew/neon/) - Shares pkgdb curated category or tags: c-library, cli, http, networking.
- [telnet](https://pkg.so/zh-hans/brew/telnet/) - Shares pkgdb curated category or tags: cli, networking, protocol.
- [gsasl](https://pkg.so/zh-hans/brew/gsasl/) - Shares pkgdb curated category or tags: c-library, cli, networking.
- [ldns](https://pkg.so/zh-hans/brew/ldns/) - Shares pkgdb curated category or tags: c-library, cli, networking.
- [libpcap](https://pkg.so/zh-hans/brew/libpcap/) - Shares pkgdb curated category or tags: c-library, cli, networking.
- [oha](https://pkg.so/zh-hans/brew/oha/) - Shares pkgdb curated category or tags: cli, http, networking.
- [libdnet](https://pkg.so/zh-hans/brew/libdnet/) - Shares pkgdb curated category or tags: c-library, cli, networking.
- [aria2](https://pkg.so/zh-hans/brew/aria2/) - Local package facts share a topical domain. Shared terms: ares, c-ares, cli, http, networking.
- [gensio](https://pkg.so/zh-hans/brew/gensio/) - Local package facts share a topical domain. Shared terms: c-library, cli, networking, openssl, openssl-3.

## Combined YAML source

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


## 来源

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