# 使用 Homebrew, apt, dnf, MacPorts, Nix, zypper 安装 bsdiff

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

## 安装

```sh
sudo av install brew:bsdiff
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install bsdiff
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install bsdiff
```

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

### Linux

- Debian apt (92%):

```sh
sudo apt install bsdiff
```

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

- dnf (92%):

```sh
sudo dnf install bsdiff
```

  证据: Fedora Rawhide package metadata: bsdiff from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#bsdiff
```

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

- zypper (92%):

```sh
sudo zypper install bsdiff
```

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

## 软件包事实

- **软件包键:** brew:bsdiff
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/bsdiff>
- **版本:** 4.3
- **来源摘要:** Generate and apply patches to binary files
- **主页:** <https://www.daemonology.net/bsdiff/>
- **上游文档:** <https://www.daemonology.net/bsdiff>
- **许可证:** BSD-2-Clause
- **源码归档:** <https://deb.debian.org/debian/pool/main/b/bsdiff/bsdiff_4.3.orig.tar.gz>
- **已生成:** 2026-07-08T18:08:21+00:00

## 可执行文件

- bsdiff (cli)
- bsdiff (别名)

## 构建依赖

- bmake

## macOS 提供的库

- bzip2

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, catalina, monterey, sonoma, ventura

## 版本和新鲜度

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

bsdiff and bspatch are Colin Percival's binary diff and patch tools, best known for producing small patches for executable files. The package is tiny, old, and still important because binary delta updates remain a core packaging and updater trick.

### 项目历史

The official page describes bsdiff and bspatch as tools for building and applying binary patches. It explains that they use suffix sorting, specifically Larsson and Sadakane's qsufsort, and exploit the way executable files change to make much smaller patches than contemporary binary patch tools.

The same page says the programs were originally named `bdiff` and `bpatch`, but were renamed because many other programs used those names. It published version 4.3 as a tarball and identifies the BSDiff 4 algorithm with Percival's 2003 paper, `Naive differences of executable code`.

### 采用历史

By the time version 4.2 was described on the official page, bsdiff was already in the FreeBSD, NetBSD, and OpenBSD ports trees, DarwinPorts, Gentoo, and as a Python extension module. The provided package facts show wider modern packaging across Homebrew, Debian, Fedora/dnf, MacPorts, Nix, Ubuntu, and openSUSE/zypper.

bsdiff also influenced the packaging and update world indirectly: binary delta algorithms of this style are natural fits for software update systems, where shaving patch size saves bandwidth and time.

### 使用方式

`bsdiff` compares an old file and a new file to produce a compact patch; `bspatch` applies that patch to reconstruct the new file. The package is most useful for compiled binaries and other files where line-oriented text diffs are ineffective.

The official page documents its resource profile: bsdiff is memory-hungry and runs in O((n+m) log n), while bspatch runs in O(n+m). That tradeoff is acceptable for many release pipelines because patch creation happens once, while patch application may happen many times.

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

bsdiff is package-nerd famous because it is a small command with an outsized effect on binary distribution. It gives maintainers a simple way to ship deltas instead of whole files, and its paper made the algorithm understandable enough to reimplement and adapt.

It is also a classic example of a package whose upstream is not a modern forge repository. Package managers preserve the tool through tarballs, patches, and downstream maintenance even without a canonical GitHub-style source-control home.

### 时间线

- 2003: Colin Percival describes the BSDiff 4 algorithm in `Naive differences of executable code`.
- 2000s: Version 4.2 is available in FreeBSD, NetBSD, OpenBSD ports, DarwinPorts, Gentoo, and as a Python extension.
- 2005: Version 4.3 is published on the official daemonology.net bsdiff page.
- 2026: Provided package facts show bsdiff available across Homebrew, Debian, Fedora/dnf, MacPorts, Nix, Ubuntu, and openSUSE/zypper.

### Related projects

- bspatch is the companion patch-application utility shipped with bsdiff.
- xdelta is the comparison tool named by the official page for binary delta compression.
- RTPatch is the commercial binary patch tool named by the official page as another comparison point.
- FreeBSD Update is historically associated with Colin Percival's binary-update work and the wider bsdiff ecosystem.

### 来源

- <https://www.daemonology.net/bsdiff>
- <https://www.daemonology.net/papers/bsdiff.pdf>
- source_facts.package-manager


## 安全说明

narrow executable package without higher-risk signals.

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

## 源数据库详情

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

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

- Debian apt - bsdiff - 4.3-23: normalized package name match | Debian stable package indexes: bsdiff from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | generate/apply a patch between two binary files | https://www.daemonology.net/bsdiff
- Nix - bsdiff: normalized package name match | nixpkgs package indexes: pkgs/by-name/bs/bsdiff/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - bsdiff - 4.3-23: normalized package name match | Ubuntu 24.04 LTS package indexes: bsdiff from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | generate/apply a patch between two binary files | https://www.daemonology.net/bsdiff
- dnf - bsdiff - 4.3-39.fc44: normalized package name match | Fedora Rawhide package metadata: bsdiff from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Binary diff/patch utility | http://www.daemonology.net/bsdiff/
- zypper - bsdiff - 4.3-6.9: normalized package name match | openSUSE Tumbleweed package metadata: bsdiff from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Tools for binary file patches | https://daemonology.net/bsdiff
- MacPorts - bsdiff: normalized package name match | MacPorts ports tree: devel/bsdiff/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## 相关链接

- [Terminal utility packages](https://www.automicvault.com/zh-hans/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/zh-hans/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Archive and compression packages](https://www.automicvault.com/zh-hans/pkg/archive-compression-tools/) - Matched archive or compression metadata.
- [Developer build packages](https://www.automicvault.com/zh-hans/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [bmake](https://www.automicvault.com/zh-hans/pkg/brew/bmake/) - Build dependency declared by Homebrew.
- [xdelta](https://www.automicvault.com/zh-hans/pkg/brew/xdelta/) - Shares av.db curated category or tags: binary-diff, cli, delta-compression, developer-tools, diff.
- [vbindiff](https://www.automicvault.com/zh-hans/pkg/brew/vbindiff/) - Shares av.db curated category or tags: binary-diff, cli, developer-tools, diff.
- [colordiff](https://www.automicvault.com/zh-hans/pkg/brew/colordiff/) - Shares av.db curated category or tags: cli, developer-tools, diff.
- [diff-so-fancy](https://www.automicvault.com/zh-hans/pkg/brew/diff-so-fancy/) - Shares av.db curated category or tags: cli, developer-tools, diff.
- [diffnav](https://www.automicvault.com/zh-hans/pkg/brew/diffnav/) - Shares av.db curated category or tags: cli, developer-tools, diff.
- [diffoci](https://www.automicvault.com/zh-hans/pkg/brew/diffoci/) - Shares av.db curated category or tags: cli, developer-tools, diff.
- [diffoscope](https://www.automicvault.com/zh-hans/pkg/brew/diffoscope/) - Shares av.db curated category or tags: cli, developer-tools, diff.
- [diffr](https://www.automicvault.com/zh-hans/pkg/brew/diffr/) - Shares av.db curated category or tags: cli, developer-tools, diff.

## Combined YAML source

View the package source record on GitHub. [combined/bsdiff.yml](https://github.com/automic-vault/db/blob/main/combined/bsdiff.yml)


## 来源

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
