# 使用 Homebrew, apk, chocolatey, apt, dnf, MacPorts, Nix, pacman, zypper, scoop 安装 bzip2

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

## 安装

```sh
sudo av install brew:bzip2
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install bzip2
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install bzip2
```

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

### Linux

- apk (92%):

```sh
sudo apk add bzip2
```

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

- Debian apt (92%):

```sh
sudo apt install bzip2
```

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

- dnf (92%):

```sh
sudo dnf install bzip2
```

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

  证据: nixpkgs package indexes: bzip2 from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S bzip2
```

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

- zypper (92%):

```sh
sudo zypper install bzip2
```

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

### Windows

- Chocolatey (92%):

```sh
choco install bzip2
```

  证据: Chocolatey community package catalog: bzip2 from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='8.17','wwphone-cti'

- Scoop (92%):

```sh
scoop install main/bzip2
```

  证据: Scoop official bucket manifest trees: bucket/bzip2.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:bzip2
- **软件包管理器:** Homebrew
- **版本:** 1.0.8
- **来源摘要:** Freely available high-quality data compressor
- **主页:** <https://sourceware.org/bzip2/>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- bunzip2 (别名)
- bzcat (别名)
- bzcmp (别名)
- bzdiff (别名)
- bzegrep (别名)
- bzfgrep (别名)
- bzgrep (别名)
- bzip2 (别名)
- bzip2recover (别名)
- bzless (别名)
- bzmore (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

bzip2 is Julian Seward's open-source block-sorting compressor and its companion library, libbzip2. Since the late 1990s it has been one of the standard Unix compression formats for source tarballs, backups, package payloads, and long-lived archives.

### 项目历史

The official bzip2 manual identifies Julian Seward as author and gives the 1.0.8 manual release date as 13 July 2019, with copyright running from 1996 through 2019. The Sourceware home page describes bzip2 as a freely available, patent-free, high-quality data compressor organized as both a command-line program and a library.

Technically, bzip2 uses block-sorting compression associated with the Burrows-Wheeler transform, followed by entropy coding. Its design favored compression ratio over speed, and the official site positions it as typically compressing close to much heavier statistical compressors while remaining practical on ordinary Unix systems.

The 1.0 line became the compatibility anchor for the `.bz2` format and libbzip2 API. Sourceware's git tags preserve older public milestones from `bzip2-0.1` through `bzip2-1.0.8`, showing a package with a slow, conservative release culture after its format became infrastructure.

### 采用历史

bzip2 adoption followed the familiar Unix pattern: first as a better-compressing alternative to gzip, then as a standard option in tar pipelines, release archives, Linux distributions, and package managers. The command names `bzip2`, `bunzip2`, and `bzcat` intentionally echo gzip's workflow, reducing friction for shell users.

The package's presence across Homebrew, Debian, Ubuntu, Fedora, Alpine, Arch, MacPorts, Nix, Chocolatey, Scoop, and openSUSE reflects near-universal distribution. Even where xz and zstd displaced it for many new archives, bzip2 remains installed because decades of `.bz2` artifacts still need reliable decompression.

### 使用方式

Users compress files with `bzip2`, decompress with `bunzip2`, stream with `bzcat`, compare or diff compressed files with `bzcmp` and `bzdiff`, and recover damaged block-based archives with `bzip2recover`.

Developers use libbzip2 when applications need to read or write `.bz2` streams directly. The official manual documents both the command interface and the programming interface, which is why package managers usually split runtime tools and development headers.

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

bzip2 is package-nerd bedrock: it is one of the archive formats every build tool, mirror, bootstrap script, and source-fetching system eventually has to understand. A working `bunzip2` is boring until a historical tarball or distro source package requires it.

It is also a case study in conservative infrastructure. The compressor is no longer fashionable, but its stable format, simple commands, portable C implementation, and widespread packaging make it one of the quiet dependencies that keeps old source distribution workflows reproducible.

### 时间线

- 1996: Julian Seward's bzip2 copyright history begins.
- 1997: Early public tags such as `bzip2-0.1` appear in the official Sourceware git history.
- 2000: The 1.0 series establishes the long-lived format and library baseline.
- 2010: bzip2 1.0.6 becomes a widely packaged stable release.
- 2019: bzip2 1.0.8 is released and documented as the current stable version on Sourceware.

### Related projects

- gzip is the older Unix compressor whose command-line conventions bzip2 intentionally resembles.
- xz, zstd, and lzip are common later alternatives in source distribution and package-manager ecosystems.
- libbzip2 is the library interface shipped with the command-line program for applications that need `.bz2` support.

### 来源

- <https://sourceware.org/bzip2/>
- <https://sourceware.org/bzip2/manual/manual.html>
- <https://sourceware.org/git/?p=bzip2.git;a=summary>
- source_facts.package-manager


## 安全说明

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

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

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

- Debian apt - bzip2 - 1.0.8-6: normalized package name match | Debian stable package indexes: bzip2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | high-quality block-sorting file compressor - utilities | https://sourceware.org/bzip2/
- Debian apt - bzip2-doc - 1.0.8-6: normalized package name match | Debian stable package indexes: bzip2-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | high-quality block-sorting file compressor - documentation | https://sourceware.org/bzip2/
- Debian apt - libbz2-1.0 - 1.0.8-6: normalized package name match | Debian stable package indexes: libbz2-1.0 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | high-quality block-sorting file compressor library - runtime | https://sourceware.org/bzip2/
- Debian apt - libbz2-dev - 1.0.8-6: normalized package name match | Debian stable package indexes: libbz2-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | high-quality block-sorting file compressor library - development | https://sourceware.org/bzip2/
- Nix - bzip2: normalized package name match | nixpkgs package indexes: bzip2 from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - bzip2 - 1.0.8-5.1: normalized package name match | Ubuntu 24.04 LTS package indexes: bzip2 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | high-quality block-sorting file compressor - utilities | https://sourceware.org/bzip2/
- Ubuntu apt - bzip2-doc - 1.0.8-5.1: normalized package name match | Ubuntu 24.04 LTS package indexes: bzip2-doc from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | high-quality block-sorting file compressor - documentation | https://sourceware.org/bzip2/
- Ubuntu apt - libbz2-1.0 - 1.0.8-5.1: normalized package name match | Ubuntu 24.04 LTS package indexes: libbz2-1.0 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | high-quality block-sorting file compressor library - runtime | https://sourceware.org/bzip2/
- Ubuntu apt - libbz2-dev - 1.0.8-5.1: normalized package name match | Ubuntu 24.04 LTS package indexes: libbz2-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | high-quality block-sorting file compressor library - development | https://sourceware.org/bzip2/
- apk - bzip2 - 1.0.8-r6: normalized package name match | Alpine Linux edge package indexes: bzip2 from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A high-quality data compression program | https://sourceware.org/bzip2/
- apk - bzip2-dev - 1.0.8-r6: normalized package name match | Alpine Linux edge package indexes: bzip2-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A high-quality data compression program (development files) | https://sourceware.org/bzip2/
- apk - bzip2-doc - 1.0.8-r6: normalized package name match | Alpine Linux edge package indexes: bzip2-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A high-quality data compression program (documentation) | https://sourceware.org/bzip2/
- apk - bzip2-static - 1.0.8-r6: normalized package name match | Alpine Linux edge package indexes: bzip2-static from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A high-quality data compression program (static library) | https://sourceware.org/bzip2/
- apk - libbz2 - 1.0.8-r6: normalized package name match | Alpine Linux edge package indexes: libbz2 from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Shared library for bz2 | https://sourceware.org/bzip2/
- dnf - bzip2 - 1.0.8-24.fc45: normalized package name match | Fedora Rawhide package metadata: bzip2 from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | File compression utility | https://sourceware.org/bzip2
- dnf - bzip2-devel - 1.0.8-24.fc45: normalized package name match | Fedora Rawhide package metadata: bzip2-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Libraries and header files for apps which will use bzip2 | https://sourceware.org/bzip2


## Combined YAML source

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