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

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

## 安装

```sh
sudo av install brew:nng
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install nng
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install nng
```

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

### Linux

- apk (92%):

```sh
sudo apk add nng
```

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

- dnf (92%):

```sh
sudo dnf install nng
```

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

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

- pacman (92%):

```sh
sudo pacman -S nng
```

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

- Debian apt (92%):

```sh
sudo apt install libnng-dev
```

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

- zypper (92%):

```sh
sudo zypper install libnng1
```

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

## 软件包事实

- **软件包键:** brew:nng
- **软件包管理器:** Homebrew
- **版本:** 1.12.0
- **来源摘要:** Nanomsg-next-generation -- light-weight brokerless messaging
- **主页:** <https://nng.nanomsg.org/>
- **仓库:** <https://github.com/nanomsg/nng>
- **最后更新:** 2026-06-28T03:47:06Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- nngcat (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

NNG, short for nanomsg-next-generation, is a C messaging library that reworks nanomsg's brokerless Scalability Protocols model with stronger production, async, transport, and security foundations.

### 项目历史

The upstream README explicitly describes NNG as a rewrite of the Scalability Protocols library known as nanomsg, keeping compatibility with the original while adding significant capabilities. Its self-description places it in the same family as nanomsg and, to a lesser extent, ZeroMQ: lightweight brokerless messaging for recurring patterns such as publish/subscribe, request/reply, and service discovery.

The rewrite emphasized reliability, scalability, maintainability, extensibility, security, and usability. Notable package-level changes include a C11/CMake build, a custom asynchronous I/O framework, TLS-capable transports, and APIs intended to be more intuitive for concurrent programs.

### 采用历史

NNG's adoption is developer-library adoption: it is packaged as libnng-dev or nng across Homebrew, Debian/Ubuntu, Fedora, Alpine, Arch, Nix, MacPorts, and openSUSE, and it exposes nngcat as a CLI utility. The repository also documents commercial support and sponsorship, which is meaningful for a low-level C messaging library used in production systems.

Compatibility was a core adoption strategy. The project documented migration from legacy libnanomsg and offered wire/API compatibility for many nanomsg and mangos applications, letting existing Scalability Protocols users move incrementally instead of rewriting their messaging layer at once.

### 使用方式

Developers use NNG when they want simple message-pattern APIs without standing up a broker. Common package-nerd experiments use nngcat to test pub/sub or req/rep endpoints, then embed libnng in C or bind through another language for IPC, TCP, WebSocket, TLS, or in-process transport.

The practical distinction from heavier messaging stacks is that NNG tries to own the boring plumbing: reconnects, connection management, async dispatch, and protocol state. That makes it attractive for embedded systems, appliances, developer tools, and service components where a full broker is excessive.

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

NNG matters because it is the active successor path for nanomsg-style messaging. It preserves the idea that common distributed communication patterns can be expressed as small socket-like protocols while modernizing the implementation enough for safer concurrent production use.

### 时间线

- {'event': "NNG emerged as a next-generation rewrite of nanomsg's Scalability Protocols library.", 'year': '2010s'}
- {'date': '2026-06-28', 'event': 'The GitHub repository page listed Version 1.12 Bug Fix Release as the latest release.'}

### Related projects

- nanomsg
- ZeroMQ
- mangos
- nngcat

### 来源

- <https://github.com/nanomsg/nng>
- <https://github.com/nanomsg/nng/blob/main/docs/ref/migrate/nanomsg.md>
- <https://nng.nanomsg.org/>
- <https://nng.nanomsg.org/man/tip/nng.7.html>
- <https://raw.githubusercontent.com/nanomsg/nng/main/README.md>


## 安全说明

narrow executable package without higher-risk signals.

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

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

- Debian apt - libnng-dev - 1.10.1-2: normalized package name match | Debian stable package indexes: libnng-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Lightweight Messaging Library - development | https://nng.nanomsg.org/
- Debian apt - libnng-doc - 1.10.1-2: normalized package name match | Debian stable package indexes: libnng-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Lightweight Messaging Library - HTML documentation | https://nng.nanomsg.org/
- Debian apt - libnng1 - 1.10.1-2: normalized package name match | Debian stable package indexes: libnng1 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Lightweight Messaging Library - shared library | https://nng.nanomsg.org/
- Debian apt - nng-utils - 1.10.1-2: normalized package name match | Debian stable package indexes: nng-utils from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Lightweight Messaging Library - utility | https://nng.nanomsg.org/
- Nix - nng: normalized package name match | nixpkgs package indexes: pkgs/by-name/nn/nng/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libnng-dev - 1.7.2-1build2: normalized package name match | Ubuntu 24.04 LTS package indexes: libnng-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Lightweight Messaging Library - development | https://nng.nanomsg.org/
- Ubuntu apt - libnng1 - 1.7.2-1build2: normalized package name match | Ubuntu 24.04 LTS package indexes: libnng1 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Lightweight Messaging Library - shared library | https://nng.nanomsg.org/
- Ubuntu apt - nng-utils - 1.7.2-1build2: normalized package name match | Ubuntu 24.04 LTS package indexes: nng-utils from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Lightweight Messaging Library - utility | https://nng.nanomsg.org/
- apk - nng - 1.12.0-r0: normalized package name match | Alpine Linux edge package indexes: nng from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Lightweight Broker-Less Messaging Library | https://nng.nanomsg.org/
- apk - nng-dev - 1.12.0-r0: normalized package name match | Alpine Linux edge package indexes: nng-dev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Lightweight Broker-Less Messaging Library (development files) | https://nng.nanomsg.org/
- apk - nng-doc - 1.12.0-r0: normalized package name match | Alpine Linux edge package indexes: nng-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Lightweight Broker-Less Messaging Library (documentation) | https://nng.nanomsg.org/
- dnf - nng - 1.9.0-6.fc45: normalized package name match | Fedora Rawhide package metadata: nng from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Light-weight brokerless messaging | https://nanomsg.github.io/nng/
- dnf - nng-devel - 1.9.0-6.fc45: normalized package name match | Fedora Rawhide package metadata: nng-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Development files for the nng socket library | https://nanomsg.github.io/nng/
- dnf - nng-utils - 1.9.0-6.fc45: normalized package name match | Fedora Rawhide package metadata: nng-utils from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Command line interface for communicating with nng | https://nanomsg.github.io/nng/
- pacman - nng - 1.12.0-1: normalized package name match | Arch Linux sync databases: nng from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A lightweight, broker-less messaging library | https://nng.nanomsg.org/
- zypper - libnng1 - 1.12.0-1.3: normalized package name match | openSUSE Tumbleweed package metadata: libnng1 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Shared library for nng | https://nanomsg.github.io/nng/


## Combined YAML source

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