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

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

## 安装

```sh
sudo av install brew:nspr
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install nspr
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install nspr
```

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

### Linux

- apk (92%):

```sh
sudo apk add nspr
```

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

- dnf (92%):

```sh
sudo dnf install nspr
```

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

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

- pacman (92%):

```sh
sudo pacman -S nspr
```

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

- Debian apt (92%):

```sh
sudo apt install libnspr4
```

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

## 软件包事实

- **软件包键:** brew:nspr
- **软件包管理器:** Homebrew
- **版本:** 4.39
- **来源摘要:** Platform-neutral API for system-level and libc-like functions
- **主页:** <https://hg.mozilla.org/projects/nspr>
- **最后更新:** 2026-05-05T19:04:27Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- nspr-config (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

NSPR, the Netscape Portable Runtime, is a C portability layer from the Netscape/Mozilla lineage. It abstracts non-GUI operating-system services such as threads, synchronization, file and network I/O, time, memory allocation, and shared-library loading so Mozilla-era code can run across many Unix, Windows, and macOS targets.

### 项目历史

Mozilla's NSPR history says the first generation was conceived to satisfy Java VM porting requirements, while the second-generation NSPR20 effort started in 1996 and expanded the idea into a general portability layer for C and C++ clients. The same page describes NSPR as functionally complete and in sustaining engineering, which matches its role as old, boring infrastructure rather than a fast-moving application framework.

### 采用历史

Mozilla's documentation says NSPR is used by Mozilla clients plus many Red Hat and Oracle server applications. Its most visible downstream role is as the portability substrate for NSS, so package managers often install it indirectly through security libraries rather than because an end user asked for `nspr-config` by name.

On July 1, 2026, Homebrew's formula page listed NSPR 4.39 and reported 273,494 installs in its 365-day analytics window, but only 3,006 installs on request. That gap is a good package-nerd signal: NSPR is mostly dependency plumbing.

### 使用方式

Developers use NSPR directly when maintaining old Mozilla-family C/C++ code or software that already expects NSPR APIs. Practically, package users see headers, libraries, and `nspr-config`; modern greenfield projects usually choose native OS APIs, pthreads, or higher-level runtimes unless they need compatibility with NSS/Mozilla code.

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

NSPR matters because it is one of the tiny base layers beneath a surprising amount of browser and PKI software. It is not fashionable infrastructure, but build failures here ripple into NSS and packages that consume NSS.

### 时间线

- 1996: the NSPR20 second-generation effort began, rebuilding the original Java-porting portability layer into a broader runtime API.
- July 1, 2026: Homebrew formula analytics listed NSPR 4.39 with large dependency-driven install volume.

### Related projects

- NSS depends on NSPR for cross-platform I/O and threading semantics.

### 来源

- <https://firefox-source-docs.mozilla.org/nspr/about_nspr.html>
- <https://firefox-source-docs.mozilla.org/nspr/index.html>
- <https://formulae.brew.sh/formula/nspr>


## 安全说明

narrow executable package without higher-risk signals.

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

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

- Debian apt - libnspr4 - 2:4.36-1: normalized package name match | Debian stable package indexes: libnspr4 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | NetScape Portable Runtime Library | http://www.mozilla.org/projects/nspr/
- Debian apt - libnspr4-dev - 2:4.36-1: normalized package name match | Debian stable package indexes: libnspr4-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Development files for the NetScape Portable Runtime library | http://www.mozilla.org/projects/nspr/
- Nix - nspr: normalized package name match | nixpkgs package indexes: pkgs/by-name/ns/nspr/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libnspr4 - 2:4.35-1.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libnspr4 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | NetScape Portable Runtime Library | http://www.mozilla.org/projects/nspr/
- Ubuntu apt - libnspr4-dev - 2:4.35-1.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libnspr4-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Development files for the NetScape Portable Runtime library | http://www.mozilla.org/projects/nspr/
- apk - nspr - 4.38.2-r0: normalized package name match | Alpine Linux edge package indexes: nspr from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Netscape Portable Runtime | https://www.mozilla.org/projects/nspr/
- apk - nspr-dev - 4.38.2-r0: normalized package name match | Alpine Linux edge package indexes: nspr-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Netscape Portable Runtime (development files) | https://www.mozilla.org/projects/nspr/
- dnf - nspr - 4.39.0-5.fc45: normalized package name match | Fedora Rawhide package metadata: nspr from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Netscape Portable Runtime | http://www.mozilla.org/projects/nspr/
- pacman - nspr - 4.39-1: normalized package name match | Arch Linux sync databases: nspr from https://geo.mirror.pkgbuild.com/core/os/x86_64/core.db.tar.gz | Netscape Portable Runtime | https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR
- MacPorts - nspr: normalized package name match | MacPorts ports tree: devel/nspr/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

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