# 使用 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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-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
- **版本:** 3.8.9
- **来源摘要:** Multi-format archive and compression library
- **主页:** <https://www.libarchive.org>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

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

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

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

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

- 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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-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/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Extract files from a ZIP archive | https://www.libarchive.org/


## 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
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
