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

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

## 安装

```sh
sudo av install brew:libarchive
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install libarchive
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install libarchive
```

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

### Linux

- apk (92%):

```sh
sudo apk add libarchive
```

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

- dnf (92%):

```sh
sudo dnf install libarchive
```

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

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

- pacman (92%):

```sh
sudo pacman -S libarchive
```

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

- Debian apt (92%):

```sh
sudo apt install libarchive-dev
```

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

- zypper (92%):

```sh
sudo zypper install bsdtar
```

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

## 软件包事实

- **软件包键:** brew:libarchive
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/libarchive>
- **版本:** 3.8.9
- **来源摘要:** Multi-format archive and compression library
- **主页:** <https://www.libarchive.org>
- **上游文档:** <https://www.libarchive.org>
- **许可证:** BSD-2-Clause
- **源码归档:** <https://www.libarchive.org/downloads/libarchive-3.8.9.tar.xz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- bsdcat (cli)
- bsdcpio (cli)
- bsdtar (cli)
- bsdunzip (cli)
- bsdcat (别名)
- bsdcpio (别名)
- bsdtar (别名)
- bsdunzip (别名)

## 依赖

- libb2
- lz4
- xz
- zstd

## macOS 提供的库

- bzip2
- expat

## 安装行为

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

## 版本和新鲜度

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

libarchive is a portable C library and command-line tool suite for reading and writing many archive formats. It ships bsdtar, bsdcpio, bsdcat, and bsdunzip, making it both a developer library and a practical Unix toolbox package.

### 项目历史

The project began in the FreeBSD orbit and was first released in 2006, according to its own libarchive 3.0 transition notes. Its design emphasized streaming, automatic format detection, and a single API that could handle tar, cpio, zip, ISO images, compression filters, and later many more formats.

### 采用历史

libarchive spread widely because packaging systems, installers, build tools, and OS utilities all need to unpack archives without shelling out to a pile of format-specific programs. Its bsdtar and bsdcpio utilities became FreeBSD-associated alternatives to GNU tar and cpio, while the library itself was packaged across Linux, macOS, BSD, and Windows-oriented environments.

### 使用方式

Applications link libarchive to read and write archives through one API, while users run bsdtar, bsdcpio, bsdcat, or bsdunzip. The project site emphasizes automatic handling of archive-plus-compression combinations such as tar.gz and support for POSIX-like systems plus Windows.

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

libarchive is one of those packages that quietly makes package managers work. Its importance is in boring reliability: many archive formats, many platforms, a test suite, and CLI tools that can replace multiple single-format utilities.

### 时间线

- 2006: libarchive was first released.
- 2011-12: libarchive 3.0 was released after nearly two years of development since 2.8.
- 2016-04-30: libarchive 3.2.0 added bsdcat, LZ4, WARC, raw writer, and ZIP64-related features.
- 2018-09-03: libarchive 3.3.3 included Zstandard read and write filters.
- 2023-07-14: the project recorded a bsdunzip port from FreeBSD in NEWS.

### Related projects

- Related projects include FreeBSD tar and cpio tooling, GNU tar, Info-ZIP, zlib, bzip2, xz, lz4, zstd, archive-consuming package managers, and installers.

### 来源

- <https://github.com/libarchive/libarchive>
- <https://github.com/libarchive/libarchive/blob/master/NEWS>
- <https://github.com/libarchive/libarchive/wiki>
- <https://github.com/libarchive/libarchive/wiki/Libarchive3>
- <https://github.com/libarchive/libarchive/wiki/ReleaseNotes>
- <https://www.libarchive.org>


## 安全说明

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:** libarchive
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** yes
- **URL Keys:** stable

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

- Debian apt - libarchive-dev - 3.7.4-4+deb13u1: normalized package name match | Debian stable package indexes: libarchive-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Multi-format archive and compression library (development files) | https://www.libarchive.org/
- Debian apt - libarchive-tools - 3.7.4-4+deb13u1: normalized package name match | Debian stable package indexes: libarchive-tools from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | FreeBSD implementations of 'tar' and 'cpio' and other archive tools | https://www.libarchive.org/
- Debian apt - libarchive13t64 - 3.7.4-4+deb13u1: normalized package name match | Debian stable package indexes: libarchive13t64 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Multi-format archive and compression library (shared library) | https://www.libarchive.org/
- Nix - libarchive: normalized package name match | nixpkgs package indexes: pkgs/by-name/li/libarchive/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libarchive-dev - 3.7.2-2: normalized package name match | Ubuntu 24.04 LTS package indexes: libarchive-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Multi-format archive and compression library (development files) | https://www.libarchive.org/
- Ubuntu apt - libarchive-tools - 3.7.2-2: normalized package name match | Ubuntu 24.04 LTS package indexes: libarchive-tools from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | FreeBSD implementations of 'tar' and 'cpio' and other archive tools | https://www.libarchive.org/
- Ubuntu apt - libarchive13t64 - 3.7.2-2: normalized package name match | Ubuntu 24.04 LTS package indexes: libarchive13t64 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Multi-format archive and compression library (shared library) | https://www.libarchive.org/
- apk - libarchive - 3.8.8-r0: normalized package name match | Alpine Linux edge package indexes: libarchive from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | library that can create and read several streaming archive formats | https://libarchive.org/
- apk - libarchive-dev - 3.8.8-r0: normalized package name match | Alpine Linux edge package indexes: libarchive-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | library that can create and read several streaming archive formats (development files) | https://libarchive.org/
- apk - libarchive-doc - 3.8.8-r0: normalized package name match | Alpine Linux edge package indexes: libarchive-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | library that can create and read several streaming archive formats (documentation) | https://libarchive.org/
- apk - libarchive-static - 3.8.8-r0: normalized package name match | Alpine Linux edge package indexes: libarchive-static from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | library that can create and read several streaming archive formats (static library) | https://libarchive.org/
- apk - libarchive-tools - 3.8.8-r0: normalized package name match | Alpine Linux edge package indexes: libarchive-tools from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | libarchive tools bsdtar and bsdcpio | https://libarchive.org/
- dnf - bsdcat - 3.8.8-3.fc45: normalized package name match | Fedora Rawhide package metadata: bsdcat from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Expand files to standard output | https://www.libarchive.org/
- dnf - bsdcpio - 3.8.8-3.fc45: normalized package name match | Fedora Rawhide package metadata: bsdcpio from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Copy files to and from archives | https://www.libarchive.org/
- dnf - bsdtar - 3.8.8-3.fc45: normalized package name match | Fedora Rawhide package metadata: bsdtar from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Manipulate tape archives | https://www.libarchive.org/
- dnf - bsdunzip - 3.8.8-3.fc45: normalized package name match | Fedora Rawhide package metadata: bsdunzip from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Extract files from a ZIP archive | https://www.libarchive.org/


## 相关链接

- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Archive and compression packages](https://pkg.so/zh-hans/archive-compression-tools/) - Matched archive or compression metadata.
- [Developer build packages](https://pkg.so/zh-hans/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [xz](https://pkg.so/zh-hans/brew/xz/) - Runtime dependency declared by Homebrew.
- [zstd](https://pkg.so/zh-hans/brew/zstd/) - Runtime dependency declared by Homebrew.
- [lz4](https://pkg.so/zh-hans/brew/lz4/) - Runtime dependency declared by Homebrew.
- [tesseract](https://pkg.so/zh-hans/brew/tesseract/) - Popular package that depends on this formula.
- [ghostscript](https://pkg.so/zh-hans/brew/ghostscript/) - Popular package that depends on this formula.
- [gdal](https://pkg.so/zh-hans/brew/gdal/) - Popular package that depends on this formula.
- [opencv](https://pkg.so/zh-hans/brew/opencv/) - Popular package that depends on this formula.
- [mpv](https://pkg.so/zh-hans/brew/mpv/) - Popular package that depends on this formula.
- [vips](https://pkg.so/zh-hans/brew/vips/) - Popular package that depends on this formula.
- [ffmpeg-full](https://pkg.so/zh-hans/brew/ffmpeg-full/) - Popular package that depends on this formula.
- [zip](https://pkg.so/zh-hans/brew/zip/) - Shares pkgdb curated category or tags: archive, cli, compression, developer-tools, zip.
- [libdeflate](https://pkg.so/zh-hans/brew/libdeflate/) - Shares pkgdb curated category or tags: cli, compression, developer-tools, library.
- [makeself](https://pkg.so/zh-hans/brew/makeself/) - Shares pkgdb curated category or tags: cli, compression, developer-tools, tar.
- [advancecomp](https://pkg.so/zh-hans/brew/advancecomp/) - Shares pkgdb curated category or tags: cli, compression, developer-tools, zip.
- [ancient](https://pkg.so/zh-hans/brew/ancient/) - Shares pkgdb curated category or tags: archive, cli, developer-tools, library.
- [py7zr](https://pkg.so/zh-hans/brew/py7zr/) - Shares pkgdb curated category or tags: archive, cli, compression, developer-tools.
- [glib](https://pkg.so/zh-hans/brew/glib/) - Shares pkgdb curated category or tags: cli, developer-tools, library.
- [harfbuzz](https://pkg.so/zh-hans/brew/harfbuzz/) - Shares pkgdb curated category or tags: cli, developer-tools, library.
- [wandio](https://pkg.so/zh-hans/brew/wandio/) - Local package facts share a topical domain. Shared terms: cli, compression, developer, developer-tools, lz4.
- [pixz](https://pkg.so/zh-hans/brew/pixz/) - Local package facts share a topical domain. Shared terms: archive, cli, compression, developer, developer-tools.

## Combined YAML source

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