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

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

## 安装

```sh
sudo av install brew:libpcap
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install libpcap
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install libpcap
```

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

### Linux

- apk (92%):

```sh
sudo apk add libpcap
```

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

- dnf (92%):

```sh
sudo dnf install libpcap
```

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

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

- pacman (92%):

```sh
sudo pacman -S libpcap
```

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

- Debian apt (92%):

```sh
sudo apt install libpcap-dev
```

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

- zypper (92%):

```sh
sudo zypper install libpcap-devel
```

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

## 软件包事实

- **软件包键:** brew:libpcap
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/libpcap>
- **版本:** 1.10.6
- **来源摘要:** Portable library for network traffic capture
- **主页:** <https://www.tcpdump.org/>
- **仓库:** <https://github.com/the-tcpdump-group/libpcap>
- **上游文档:** <https://www.tcpdump.org/>
- **许可证:** BSD-3-Clause
- **源码归档:** <https://www.tcpdump.org/release/libpcap-1.10.6.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- pcap-config (cli)
- pcap-config (别名)

## 安装行为

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

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 1.10.6
- 本地数据: OK
- 上游仓库: https://www.tcpdump.org/
- 信息: No package-manager update timestamp was available.
- 信息: Release/tag comparison is only available for GitHub repositories.
## 项目历史与用法

libpcap is the portable packet-capture library maintained with tcpdump by The Tcpdump Group. It gives programs a common C API for capturing packets and compiling packet filters across Unix-like operating systems whose native capture interfaces differ.

### 项目历史

The project grew out of the tcpdump and Berkeley Packet Filter lineage. Steve McCanne's SharkFest 2011 talk traces the packet-capture work back to a 1988 Berkeley/Lawrence Berkeley Laboratory setting, while the 1993 BPF paper documents the kernel/user-level filtering architecture that made efficient capture practical.

The Tcpdump Group later maintained libpcap as a separate library paired with tcpdump. The repository and CHANGES file show long-running attention to operating-system capture backends, filter syntax, savefile reading, remote capture support, and ABI concerns.

### 采用历史

libpcap became infrastructure rather than an end-user application: tcpdump, analyzers, monitors, and security tools can link against one API while relying on each operating system's capture mechanism underneath. The upstream README explicitly addresses Linux distributions and BSD systems that ship libpcap and warns packagers not to encode release-specific sonames.

Its adoption is also tied to the pcap file and filter culture around tcpdump: packet captures, reproducible troubleshooting, and command-line network forensics all use libpcap conventions even when users interact through higher-level tools.

### 使用方式

Developers use libpcap to enumerate capture devices, open live or saved captures, compile packet filters, and read packet records. Package-manager users usually install it as a dependency of network tools or as development headers for software that needs packet capture.

The small `pcap-config` utility is package-nerd visible because build systems and ports use it to discover compiler and linker flags for libpcap.

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

libpcap matters because it is a thin but durable portability layer over messy kernel capture APIs. It is the package that turns packet capture from an operating-system-specific problem into a linkable library dependency.

It is also a classic packaging stress test: headers, shared-library ABI, privileged capture behavior, optional capture backends, and security-sensitive parsers all meet in one small C library.

### 时间线

- 1988: tcpdump and BPF lineage begins in the Berkeley/Lawrence Berkeley Laboratory packet-capture work described by Steve McCanne.
- 1993: The BSD Packet Filter paper documents the efficient packet filtering architecture behind the tcpdump/libpcap family.
- 2003-11-12: The libpcap CHANGES file records the 0.8 release summary.
- 2008-10-27: The libpcap CHANGES file records the 1.0.0 release summary.
- 2023-04-07: The libpcap CHANGES file records the 1.10.4 release summary.

### Related projects

- tcpdump is libpcap's sibling command-line analyzer and the most direct companion project.
- BPF is the filtering architecture behind libpcap filter compilation and efficient packet selection.
- WinPcap and Npcap are Windows-oriented relatives in the pcap ecosystem, while Wireshark is a major downstream packet-analysis application in the same capture-file culture.

### 来源

- <https://github.com/the-tcpdump-group/libpcap>
- <https://raw.githubusercontent.com/the-tcpdump-group/libpcap/master/CHANGES>
- <https://sharkfest.wireshark.org/retrospective/sfus/presentations11/McCanne-Sharkfest%2711_Keynote_Address.pdf>
- <https://www.tcpdump.org/>
- <https://www.usenix.org/legacy/publications/library/proceedings/sd93/mccanne.pdf>


## 安全说明

library-like package without higher-risk signals.

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

## 源数据库详情

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

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

- Debian apt - libpcap-dev - 1.10.5-2: normalized package name match | Debian stable package indexes: libpcap-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | development library for libpcap (transitional package) | https://www.tcpdump.org/
- Debian apt - libpcap0.8-dev - 1.10.5-2: normalized package name match | Debian stable package indexes: libpcap0.8-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | development library and header files for libpcap0.8t64 | https://www.tcpdump.org/
- Debian apt - libpcap0.8t64 - 1.10.5-2: normalized package name match | Debian stable package indexes: libpcap0.8t64 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | system interface for user-level packet capture | https://www.tcpdump.org/
- Nix - libpcap: normalized package name match | nixpkgs package indexes: pkgs/by-name/li/libpcap/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libpcap-dev - 1.10.4-4.1ubuntu3: normalized package name match | Ubuntu 24.04 LTS package indexes: libpcap-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | development library for libpcap (transitional package) | https://www.tcpdump.org/
- Ubuntu apt - libpcap0.8-dev - 1.10.4-4.1ubuntu3: normalized package name match | Ubuntu 24.04 LTS package indexes: libpcap0.8-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | development library and header files for libpcap0.8t64 | https://www.tcpdump.org/
- Ubuntu apt - libpcap0.8t64 - 1.10.4-4.1ubuntu3: normalized package name match | Ubuntu 24.04 LTS package indexes: libpcap0.8t64 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | system interface for user-level packet capture | https://www.tcpdump.org/
- apk - libpcap - 1.10.6-r1: normalized package name match | Alpine Linux edge package indexes: libpcap from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Portable library for network traffic capture | https://www.tcpdump.org/
- apk - libpcap-dev - 1.10.6-r1: normalized package name match | Alpine Linux edge package indexes: libpcap-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Portable library for network traffic capture (development files) | https://www.tcpdump.org/
- apk - libpcap-doc - 1.10.6-r1: normalized package name match | Alpine Linux edge package indexes: libpcap-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Portable library for network traffic capture (documentation) | https://www.tcpdump.org/
- dnf - libpcap - 1.10.6-3.fc45: normalized package name match | Fedora Rawhide package metadata: libpcap from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | A system-independent interface for user-level packet capture | https://www.tcpdump.org/
- dnf - libpcap-devel - 1.10.6-3.fc45: normalized package name match | Fedora Rawhide package metadata: libpcap-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Libraries and header files for the libpcap library | https://www.tcpdump.org/
- pacman - libpcap - 1.10.6-1: normalized package name match | Arch Linux sync databases: libpcap from https://geo.mirror.pkgbuild.com/core/os/x86_64/core.db.tar.gz | A system-independent interface for user-level packet capture | https://www.tcpdump.org/
- zypper - libpcap-devel - 1.10.6-1.6: normalized package name match | openSUSE Tumbleweed package metadata: libpcap-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A Library for Network Sniffers | https://www.tcpdump.org/
- zypper - libpcap-devel-32bit - 1.10.6-1.6: normalized package name match | openSUSE Tumbleweed package metadata: libpcap-devel-32bit from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A Library for Network Sniffers | https://www.tcpdump.org/
- zypper - libpcap-devel-static - 1.10.6-1.6: normalized package name match | openSUSE Tumbleweed package metadata: libpcap-devel-static from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A Library for Network Sniffers | https://www.tcpdump.org/


## 相关链接

- [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.
- [Homebrew utility packages](https://pkg.so/zh-hans/brew-utility-packages/) - Matched Homebrew package provider.
- [tcpdump](https://pkg.so/zh-hans/brew/tcpdump/) - Popular package that depends on this formula.
- [pcl](https://pkg.so/zh-hans/brew/pcl/) - Popular package that depends on this formula.
- [ngrep](https://pkg.so/zh-hans/brew/ngrep/) - Popular package that depends on this formula.
- [snort](https://pkg.so/zh-hans/brew/snort/) - Popular package that depends on this formula.
- [rtabmap](https://pkg.so/zh-hans/brew/rtabmap/) - Popular package that depends on this formula.
- [visp](https://pkg.so/zh-hans/brew/visp/) - Popular package that depends on this formula.
- [iptables](https://pkg.so/zh-hans/brew/iptables/) - Popular package that depends on this formula.
- [ssldump](https://pkg.so/zh-hans/brew/ssldump/) - Popular package that depends on this formula.
- [argus](https://pkg.so/zh-hans/brew/argus/) - Shares pkgdb curated category or tags: cli, networking, packet-capture.
- [daemonlogger](https://pkg.so/zh-hans/brew/daemonlogger/) - Shares pkgdb curated category or tags: cli, networking, packet-capture.
- [gsasl](https://pkg.so/zh-hans/brew/gsasl/) - Shares pkgdb curated category or tags: c-library, cli, networking.
- [nghttp2](https://pkg.so/zh-hans/brew/nghttp2/) - 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.
- [libdnet](https://pkg.so/zh-hans/brew/libdnet/) - Shares pkgdb curated category or tags: c-library, cli, networking.
- [libnl](https://pkg.so/zh-hans/brew/libnl/) - Shares pkgdb curated category or tags: c-library, cli, networking.
- [gensio](https://pkg.so/zh-hans/brew/gensio/) - Shares pkgdb curated category or tags: c-library, cli, networking.
- [httpflow](https://pkg.so/zh-hans/brew/httpflow/) - Local package facts share a topical domain. Shared terms: capture, cli, networking, packet, packet-capture.

## Combined YAML source

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