# 使用 Homebrew, apt, dnf, Nix, zypper 安装 nanopb

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

## 安装

```sh
sudo av install brew:nanopb
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install nanopb
```

  证据: local Homebrew formula metadata

### Linux

- Debian apt (92%):

```sh
sudo apt install nanopb
```

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

- dnf (92%):

```sh
sudo dnf install nanopb
```

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

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

- zypper (92%):

```sh
sudo zypper install libprotobuf-nanopb0
```

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

## 软件包事实

- **软件包键:** brew:nanopb
- **软件包管理器:** Homebrew
- **版本:** 0.4.9.1
- **来源摘要:** C library for encoding and decoding Protocol Buffer messages
- **主页:** <https://jpa.kapsi.fi/nanopb/docs/index.html>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- nanopb_generator (别名)
- nanopb_generator.py (别名)
- protoc-gen-nanopb (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

nanopb is a small-code-size Protocol Buffers implementation in ANSI C, aimed at microcontrollers and other memory-constrained systems. Its official site describes targets with tight memory budgets under 10 kB ROM and under 1 kB RAM.

### 项目历史

The upstream license text credits Petteri Aimonen and dates the project to 2011. The GitHub repository used for development was created on 2015-04-29, and the official site points development and bug reporting to GitHub while keeping the documentation and release downloads on jpa.kapsi.fi.

The core design is deliberately embedded-first: pure C runtime, generated `.pb.c` and `.pb.h` files from `.proto` definitions, static sizing through `.options` files, no required malloc, split encoder/decoder files so projects can compile only the pieces they need, and callback streams for messages larger than available RAM.

### 采用历史

GitHub API data fetched on 2026-07-01 showed 5,454 stars and 1,027 forks, strong adoption for a niche embedded serialization library. The repository also includes Zephyr-related integration files, examples, tests, Bazel/CMake/Meson/Swift package metadata, and generator tooling, reflecting use across several embedded build systems.

Homebrew's formula JSON generated on 2026-07-01 reported stable version 0.4.9.1, an old formula name of `nanopb-generator`, 1,082 installs over 365 days, and 740 installs-on-request over 365 days. That pattern fits a toolchain component: many installs are explicit because developers need the generator and protoc integration for firmware or cross-platform protocol work.

### 使用方式

A typical user writes Protocol Buffer schemas in `.proto` files, runs `nanopb_generator.py` or `protoc-gen-nanopb` to produce C headers and sources, then compiles `pb_common.c`, `pb_encode.c`, and/or `pb_decode.c` into firmware. `.options` files set maximum field sizes so generated structs can stay static.

Package nerds use the Homebrew package mostly for the host-side generator, not because macOS is the target runtime. The generated C is then carried into firmware, RTOS, or embedded Linux builds where normal Google protobuf runtimes would be too large or too allocation-heavy.

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

nanopb is one of the standard answers when someone wants Protocol Buffers on a microcontroller without dragging in a large runtime. It keeps protobuf's schema compatibility story while making the code size, allocation behavior, and generated C output legible to embedded build systems.

### 时间线

- 2011: upstream license text credits the original nanopb copyright to Petteri Aimonen.
- 2015-04-29: nanopb/nanopb repository created on GitHub.
- 2025-08-14: Nanopb 0.4.9.1 release published.
- 2026-07-01: Homebrew formula JSON listed stable version 0.4.9.1 and 1,082 installs over 365 days.

### Related projects

- Google Protocol Buffers
- Zephyr RTOS
- grpcio-tools
- protoc

### 来源

- <https://api.github.com/repos/nanopb/nanopb>
- <https://api.github.com/repos/nanopb/nanopb/releases?per_page=5>
- <https://formulae.brew.sh/api/formula/nanopb.json>
- <https://formulae.brew.sh/formula/nanopb>
- <https://github.com/nanopb/nanopb>
- <https://jpa.kapsi.fi/nanopb/>
- <https://jpa.kapsi.fi/nanopb/docs/concepts.html>
- <https://jpa.kapsi.fi/nanopb/docs/index.html>


## 安全说明

library-like package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- library-like package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: <proto basename>.options next to the .proto file
## 其他软件包管理器记录

- Debian apt - libnanopb-dev - 0.4.9.1-1: normalized package name match | Debian stable package indexes: libnanopb-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Protocol Buffers with small code size, development files | https://jpa.kapsi.fi/nanopb/
- Debian apt - nanopb - 0.4.9.1-1: normalized package name match | Debian stable package indexes: nanopb from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Protocol Buffers with small code size | https://jpa.kapsi.fi/nanopb/
- Nix - nanopb: normalized package name match | nixpkgs package indexes: pkgs/by-name/na/nanopb/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libnanopb-dev - 0.4.8-1: normalized package name match | Ubuntu 24.04 LTS package indexes: libnanopb-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Protocol Buffers with small code size, development files | https://jpa.kapsi.fi/nanopb/
- Ubuntu apt - nanopb - 0.4.8-1: normalized package name match | Ubuntu 24.04 LTS package indexes: nanopb from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Protocol Buffers with small code size | https://jpa.kapsi.fi/nanopb/
- dnf - nanopb - 0.4.9.1-5.fc45: normalized package name match | Fedora Rawhide package metadata: nanopb from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | A small code-size Protocol Buffers implementation in ansi C | https://jpa.kapsi.fi/nanopb/
- dnf - nanopb-devel - 0.4.9.1-5.fc45: normalized package name match | Fedora Rawhide package metadata: nanopb-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Development files for nanopb | https://jpa.kapsi.fi/nanopb/
- dnf - nanopb-python3 - 0.4.9.1-5.fc45: normalized package name match | Fedora Rawhide package metadata: nanopb-python3 from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Small code-size Protocol Buffers implementation in Python | https://jpa.kapsi.fi/nanopb/
- zypper - libprotobuf-nanopb0 - 0.4.9.1-1.8: normalized package name match | openSUSE Tumbleweed package metadata: libprotobuf-nanopb0 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Shared library for nanopb | https://jpa.kapsi.fi/nanopb/
- zypper - nanopb-devel - 0.4.9.1-1.8: normalized package name match | openSUSE Tumbleweed package metadata: nanopb-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Development files for nanopb | https://jpa.kapsi.fi/nanopb/
- zypper - nanopb-source - 0.4.9.1-1.8: normalized package name match | openSUSE Tumbleweed package metadata: nanopb-source from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Source code of nanopb | https://jpa.kapsi.fi/nanopb/


## Combined YAML source

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


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
