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

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

## 安装

```sh
sudo av install brew:ngrep
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install ngrep
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install ngrep
```

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

### Linux

- apk (92%):

```sh
sudo apk add ngrep
```

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

- Debian apt (92%):

```sh
sudo apt install ngrep
```

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

- dnf (92%):

```sh
sudo dnf install ngrep
```

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

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

- pacman (92%):

```sh
sudo pacman -S ngrep
```

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

- zypper (92%):

```sh
sudo zypper install ngrep
```

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

## 软件包事实

- **软件包键:** brew:ngrep
- **软件包管理器:** Homebrew
- **版本:** 1.49.0
- **来源摘要:** Network grep
- **主页:** <https://github.com/jpr5/ngrep>
- **仓库:** <https://github.com/jpr5/ngrep>
- **最后更新:** 2026-06-25T13:37:57+02:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- ngrep (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

ngrep is "network grep": a pcap-based command-line packet analyzer that applies regular-expression or hexadecimal matching to packet payloads while also accepting BPF filters like tcpdump. It is built for quick inspection of plaintext traffic and saved capture files.

### 项目历史

ngrep was written by Jordan Ritter and dates back to the early 2000s; a freshmeat announcement for ngrep 1.39.1 appeared on April 23, 2001. The tool's identity has stayed stable: bring GNU grep-style matching to the network layer.

The project lived for years as a classic Unix network utility and later moved active issue and patch handling to GitHub. Its README still frames ngrep as a PCAP tool that understands IPv4/IPv6, TCP, UDP, ICMP, IGMP, raw packets, several link-layer interface types, and BPF filter logic.

### 采用历史

ngrep became a small but widely packaged troubleshooting utility because it sits between tcpdump and a full packet analyzer. It was included de facto in many popular distributions over decades, and the maintainer explicitly asks distribution package maintainers to forward bugs and patches so upstream can track downstream fixes.

Its adoption is bounded by encryption. ngrep is excellent for DNS, old HTTP, SMTP, SIP, IMAP, test traffic, malware beacons in plaintext, and pcap triage; it is less useful when payloads are TLS-encrypted unless the useful signal is in headers, metadata, or local decrypted test traffic.

### 使用方式

A typical workflow is `sudo ngrep -d any -W byline 'Host:|User-Agent:' tcp port 80`, or using an empty match expression with a BPF filter to print payloads for a protocol. It can read and write pcap dump files, making it useful for quick command-line passes before opening Wireshark.

Package nerds install it because it is the fast, memorable answer to "show me packets containing this string". It is especially handy on servers where a GUI analyzer is unavailable and tcpdump output is too raw for the immediate question.

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

ngrep is a survivor from the era when small C network tools solved one sharp problem well. It matters less as a dependency and more as an operator tool: a tiny package that can save a debugging session when traffic is still human-readable.

### 时间线

- 2001-04-23: ngrep 1.39.1 was announced on freshmeat.
- 2008: SourceForge tickets show Jordan Ritter still handling upstream bug fixes.
- 2026-02-08: the GitHub repository listed v1.49.0 as a release with PCRE2, Docker/Podman name-resolution, and Windows build updates.

### Related projects

- tcpdump
- libpcap
- Wireshark
- snoop
- GNU grep

### 来源

- <https://formulae.brew.sh/formula/ngrep>
- <https://github.com/jpr5/ngrep/>
- <https://github.com/jpr5/ngrep/blob/master/ngrep.8>
- <https://groups.google.com/g/fm.announce/c/jqb4TkwNbbw>
- <https://sourceforge.net/p/ngrep/bugs/30/>


## 安全说明

broad file, network, media, or database tool signal.

- **Geiger 风险:** blue / 中
- broad file, network, media, or database tool signal

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

- Debian apt - ngrep - 1.47+ds1-6: normalized package name match | Debian stable package indexes: ngrep from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | grep for network traffic | https://github.com/jpr5/ngrep
- Nix - ngrep: normalized package name match | nixpkgs package indexes: pkgs/by-name/ng/ngrep/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - ngrep - 1.47+ds1-5build2: normalized package name match | Ubuntu 24.04 LTS package indexes: ngrep from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | grep for network traffic | https://github.com/jpr5/ngrep
- apk - ngrep - 1.49.0-r0: normalized package name match | Alpine Linux edge package indexes: ngrep from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A grep-like utility that allows you to search for network packets on an interface | https://ngrep.sourceforge.net/
- apk - ngrep-dbg - 1.49.0-r0: normalized package name match | Alpine Linux edge package indexes: ngrep-dbg from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A grep-like utility that allows you to search for network packets on an interface (debug symbols) | https://ngrep.sourceforge.net/
- apk - ngrep-doc - 1.49.0-r0: normalized package name match | Alpine Linux edge package indexes: ngrep-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A grep-like utility that allows you to search for network packets on an interface (documentation) | https://ngrep.sourceforge.net/
- dnf - ngrep - 1.49.0-2.fc45: normalized package name match | Fedora Rawhide package metadata: ngrep from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Network layer grep tool | https://github.com/jpr5/ngrep
- pacman - ngrep - 1.49.0-1: normalized package name match | Arch Linux sync databases: ngrep from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A grep-like utility that allows you to search for network packets on an interface. | https://github.com/jpr5/ngrep/
- zypper - ngrep - 1.49.0-1.5: normalized package name match | openSUSE Tumbleweed package metadata: ngrep from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Network grep | https://github.com/jpr5/ngrep
- MacPorts - ngrep: normalized package name match | MacPorts ports tree: net/ngrep/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/ngrep.yml](https://github.com/mxcl/pkgdb/blob/main/combined/ngrep.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
