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

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

## 安装

```sh
sudo av install brew:nettle
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install nettle
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install nettle
```

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

### Linux

- apk (92%):

```sh
sudo apk add nettle
```

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

- dnf (92%):

```sh
sudo dnf install nettle
```

  证据: Fedora Rawhide package metadata: nettle 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#nettle
```

  证据: nixpkgs package indexes: nettle from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S nettle
```

  证据: Arch Linux sync databases: nettle from https://geo.mirror.pkgbuild.com/core/os/x86_64/core.db.tar.gz

- zypper (92%):

```sh
sudo zypper install nettle
```

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

- Debian apt (92%):

```sh
sudo apt install libhogweed6t64
```

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

## 软件包事实

- **软件包键:** brew:nettle
- **软件包管理器:** Homebrew
- **版本:** 4.0
- **来源摘要:** Low-level cryptographic library
- **主页:** <https://www.lysator.liu.se/~nisse/nettle/>
- **最后更新:** 2026-05-11T18:07:37Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- nettle-hash (别名)
- nettle-lfib-stream (别名)
- nettle-pbkdf2 (别名)
- pkcs1-conv (别名)
- sexp-conv (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

Nettle is a low-level C cryptographic library by Niels Moller. Its design goal is deliberately narrow: provide reusable primitive implementations and simple interfaces while leaving algorithm selection, memory allocation, I/O, and higher-level protocol policy to callers.

### 项目历史

The Nettle manual says the library is meant to fit many contexts, including object-oriented language toolkits, applications such as LSH or GnuPG, and even kernel space. It explains the core design by saying Nettle does the low-level crypto work and avoids algorithm selection, memory allocation, and I/O so higher-level toolkits can build their own interfaces on top.

Niels Moller's June 30, 2009 GNU announcement says Nettle 2.0 had been released on June 8, 2009 and that Nettle had become a GNU package. The same announcement highlights the 2.0 ABI break that split the library into libnettle for symmetric algorithms and libhogweed for public-key algorithms that depend on GMP.

The upstream GitLab tags show the later 3.x and 4.x release cadence: 3.10 on June 16, 2024, 3.10.2 on June 26, 2025, and 4.0 on February 4, 2026. Homebrew's nettle formula tracked stable 4.0 from the GNU mirror and depends on GMP.

### 采用历史

Nettle's ecosystem role is much larger than its command-line tools suggest. The GnuTLS manual says its cryptographic library layer supports libnettle, and notes that older GnuTLS versions used libgcrypt before switching to nettle mainly for performance and secondarily because it was simpler to use.

Package-manager adoption is broad: the av.db input records Nettle across Homebrew, Alpine, Debian/Ubuntu via libhogweed, Fedora, MacPorts, Nix, Arch, and openSUSE. Homebrew analytics generated on 2026-07-01 reported 780,093 nettle installs over 365 days, but only 8,600 installs-on-request, which is classic library behavior: most installs arrive as dependencies.

### 使用方式

Application developers include headers such as nettle/sha2.h and link with -lnettle for symmetric/hash code, or use libhogweed for public-key functionality that depends on GMP. The manual's SHA256 example demonstrates the intended low-level style: explicit context structs, caller-managed buffers, explicit lengths, and no hidden allocation.

End users usually meet Nettle through dependent software rather than by typing its bundled commands. The Homebrew formula exposes tools such as nettle-hash, nettle-pbkdf2, pkcs1-conv, sexp-conv, and nettle-lfib-stream, but its practical importance is as a crypto backend for TLS/security stacks and other packages.

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

Nettle is a package nerd's dependency graph landmark. It is small enough to audit as a C library, old enough to have stable ABI expectations, and important enough that a major version line matters to large formula rebuilds. The libnettle/libhogweed split is also a clean example of packaging ABI boundaries following real dependency boundaries.

### 时间线

- 2001: The manual-history sources identify Nettle as originally written by Niels Moller in the early 2000s.
- 2009-06-08: Nettle 2.0 was released.
- 2009-06-30: Nettle was announced as a GNU package.
- 2024-06-16: Upstream tagged Nettle 3.10.
- 2025-06-26: Upstream tagged Nettle 3.10.2.
- 2026-02-04: Upstream tagged Nettle 4.0.
- 2026-07-01: Homebrew API reported stable version 4.0 and 780,093 installs over 365 days.

### 来源

- <https://formulae.brew.sh/api/formula/nettle.json>
- <https://git.lysator.liu.se/nettle/nettle/-/tags>
- <https://lists.gnu.org/archive/html/info-gnu/2009-07/msg00000.html>
- <https://www.gnutls.org/manual/html_node/Cryptographic-Backend.html>
- <https://www.lysator.liu.se/~nisse/nettle/>
- <https://www.lysator.liu.se/~nisse/nettle/nettle.html>


## 安全说明

没有找到 nettle 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。


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

- Debian apt - libhogweed6t64 - 3.10.1-1: normalized package name match | Debian stable package indexes: libhogweed6t64 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | low level cryptographic library (public-key cryptos) | https://www.lysator.liu.se/~nisse/nettle/
- Debian apt - libnettle8t64 - 3.10.1-1: normalized package name match | Debian stable package indexes: libnettle8t64 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | low level cryptographic library (symmetric and one-way cryptos) | https://www.lysator.liu.se/~nisse/nettle/
- Debian apt - nettle-bin - 3.10.1-1: normalized package name match | Debian stable package indexes: nettle-bin from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | low level cryptographic library (binary tools) | https://www.lysator.liu.se/~nisse/nettle/
- Debian apt - nettle-dev - 3.10.1-1: normalized package name match | Debian stable package indexes: nettle-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | low level cryptographic library (development files) | https://www.lysator.liu.se/~nisse/nettle/
- Nix - nettle: normalized package name match | nixpkgs package indexes: nettle from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - libhogweed6t64 - 3.9.1-2.2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libhogweed6t64 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | low level cryptographic library (public-key cryptos) | http://www.lysator.liu.se/~nisse/nettle/
- Ubuntu apt - libnettle8t64 - 3.9.1-2.2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libnettle8t64 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | low level cryptographic library (symmetric and one-way cryptos) | http://www.lysator.liu.se/~nisse/nettle/
- Ubuntu apt - nettle-bin - 3.9.1-2.2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: nettle-bin from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | low level cryptographic library (binary tools) | http://www.lysator.liu.se/~nisse/nettle/
- Ubuntu apt - nettle-dev - 3.9.1-2.2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: nettle-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | low level cryptographic library (development files) | http://www.lysator.liu.se/~nisse/nettle/
- apk - nettle - 3.10.2-r0: normalized package name match | Alpine Linux edge package indexes: nettle from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Low-level cryptographic library | https://www.lysator.liu.se/~nisse/nettle/
- apk - nettle-dev - 3.10.2-r0: normalized package name match | Alpine Linux edge package indexes: nettle-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Low-level cryptographic library (development files) | https://www.lysator.liu.se/~nisse/nettle/
- apk - nettle-static - 3.10.2-r0: normalized package name match | Alpine Linux edge package indexes: nettle-static from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Low-level cryptographic library (static library) | https://www.lysator.liu.se/~nisse/nettle/
- apk - nettle-utils - 3.10.2-r0: normalized package name match | Alpine Linux edge package indexes: nettle-utils from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Utils for nettle | https://www.lysator.liu.se/~nisse/nettle/
- dnf - nettle - 4.0-5.fc45: normalized package name match | Fedora Rawhide package metadata: nettle from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | A low-level cryptographic library | http://www.lysator.liu.se/~nisse/nettle/
- dnf - nettle-devel - 4.0-5.fc45: normalized package name match | Fedora Rawhide package metadata: nettle-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Development headers for a low-level cryptographic library | http://www.lysator.liu.se/~nisse/nettle/
- pacman - nettle - 4.0-1: normalized package name match | Arch Linux sync databases: nettle from https://geo.mirror.pkgbuild.com/core/os/x86_64/core.db.tar.gz | A low-level cryptographic library | https://www.lysator.liu.se/~nisse/nettle


## Combined YAML source

View the package source record on GitHub. [combined/nettle.yml](https://github.com/mxcl/pkgdb/blob/main/combined/nettle.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
