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

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

## 安装

```sh
sudo av install brew:apt
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install apt
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add apt
```

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

- Debian apt (92%):

```sh
sudo apt install apt
```

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

- dnf (92%):

```sh
sudo dnf install apt
```

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

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

- pacman (92%):

```sh
sudo pacman -S apt
```

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

## 软件包事实

- **软件包键:** brew:apt
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/apt>
- **版本:** 3.3.2
- **来源摘要:** Advanced Package Tool
- **主页:** <https://wiki.debian.org/Apt>
- **上游文档:** <https://wiki.debian.org/Apt>
- **许可证:** GPL-2.0-or-later
- **源码归档:** <https://salsa.debian.org/apt-team/apt/-/archive/3.3.2/apt-3.3.2.tar.bz2>
- **最后更新:** 2026-07-31T11:59:03Z
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- apt (cli)
- apt-cache (cli)
- apt-cdrom (cli)
- apt-config (cli)
- apt-ftparchive (cli)
- apt-get (cli)
- apt-mark (cli)
- apt-sortpkgs (cli)
- apt (别名)
- apt-cache (别名)
- apt-cdrom (别名)
- apt-config (别名)
- apt-ftparchive (别名)
- apt-get (别名)
- apt-mark (别名)
- apt-sortpkgs (别名)

## 依赖

- berkeley-db@5
- bzip2
- dpkg
- lz4
- openssl@3
- perl
- sequoia-sqv
- systemd
- xxhash
- xz
- zlib-ng-compat
- zstd

## 构建依赖

- cmake
- docbook
- docbook-xsl
- doxygen
- gettext
- libxslt
- po4a
- w3m

## 安装行为

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

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 3.3.2
- 管理器更新时间: 2026-07-31
- 本地数据: OK
- 上游仓库: https://wiki.debian.org/Apt
- 信息: Release/tag comparison is only available for GitHub repositories.
## 项目历史与用法

APT, the Advanced Package Tool, is Debian's high-level package acquisition, dependency resolution, and installation interface. It turned dpkg-based systems from local package installers into repository-driven operating systems.

### 项目历史

Debian's early package management centered on dpkg and dselect. The official Debian project history names Debian 2.1 Slink, released March 9, 1999, as the release that introduced apt as a new package-management interface and describes it as a key technical innovation.

APT grew into a family of tools and libraries. The Debian Administrator's Handbook describes apt-get as the first command-line front end developed within the APT project, with apt later added as a more interactive command-line front end while apt-get retained a stable scripted interface.

The system's configuration model also became part of Debian culture: /etc/apt/sources.list and sources.list.d define repositories, apt.conf and apt.conf.d define behavior, preferences files define pinning, and auth.conf carries machine credentials for authenticated repositories.

### 采用历史

APT's adoption tracks Debian's growth. Debian's own history says apt addressed issues from Debian's continuing expansion and established a new paradigm for package acquisition and installation on open source operating systems.

Ubuntu inherited APT as a core system interface, and the supplied metadata records apt packages or compatibility packages across Homebrew, Debian, Ubuntu, Fedora/dnf, Arch/pacman, Alpine/apk, and Nix. Some non-Debian entries exist for compatibility or tooling rather than as the native system package manager.

APT also shaped the UX expectations for later package managers: update an index, install by name, resolve dependencies, upgrade the system, pin repositories, and use signed repository metadata.

### 使用方式

The everyday flow is apt update to refresh package indexes, apt install package to install dependencies and packages, apt remove or apt purge to remove software, and apt upgrade or apt full-upgrade for system updates.

Scripts and maintainer tooling often use apt-get because Debian documents its public interface as stable for automation. Humans often use apt because it has interactive defaults and output tuned for direct terminal use.

Repository configuration is text-file driven: sources.list controls where packages come from, apt.conf controls acquisition and dpkg behavior, and auth.conf stores credentials for authenticated archive access.

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

APT is one of the defining package-manager designs. It made repository metadata, dependency solving, local package archives, upgrade planning, and signed distribution channels normal parts of Linux administration.

For package nerds, APT is also the origin point for countless secondary tools: mirror managers, repository publishers, pinning front ends, unattended-upgrade systems, PPA tooling, and fleet update wrappers. Understanding APT explains a large fraction of Debian and Ubuntu packaging behavior.

Its split between dpkg as the local package database/installer and APT as the repository-aware resolver remains one of the clearest examples of layered package-management architecture.

### 时间线

- 1995: Debian 0.93R5 uses dpkg after base-system installation.
- 1999: Debian 2.1 Slink introduces apt as a new package-management interface.
- 2000s: apt-get becomes the standard command-line front end for scripted Debian package operations.
- 2010s: apt becomes the recommended interactive front end while apt-get remains the stable scripting interface.

### Related projects

- dpkg is the lower-level Debian package installer and database underneath APT.
- aptitude, Synaptic, wajig, and other front ends build around APT or the Debian package model.
- aptly and apt-dater are downstream tools in this batch that manage repositories or remote updates for apt-based systems.

### 来源

- <https://manpages.debian.org/unstable/apt/apt.conf.5.en.html>
- <https://manpages.debian.org/unstable/apt/apt_auth.conf.5.en.html>
- <https://manpages.debian.org/unstable/apt/sources.list.5.en.html>
- <https://www.debian.org/doc/manuals/apt-guide/index.en.html>
- <https://www.debian.org/doc/manuals/debian-handbook/sect.apt-get.en.html>
- <https://www.debian.org/doc/manuals/project-history/releases.en.html>
- source_facts.package-manager


## 安全说明

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

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


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: /etc/apt/apt.conf, /etc/apt/apt.conf.d/, /etc/apt/sources.list, /etc/apt/sources.list.d/

## Credential files

- Unix: /etc/apt/auth.conf, /etc/apt/auth.conf.d/*.conf
## 源数据库详情

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

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

- Debian apt - apt - 3.0.3: normalized package name match | Debian stable package indexes: apt from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | commandline package manager
- Debian apt - apt-doc - 3.0.3: normalized package name match | Debian stable package indexes: apt-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | documentation for APT
- Debian apt - apt-transport-https - 3.0.3: normalized package name match | Debian stable package indexes: apt-transport-https from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | transitional package for https support
- Debian apt - apt-utils - 3.0.3: normalized package name match | Debian stable package indexes: apt-utils from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | package management related utility programs
- Debian apt - libapt-pkg-dev - 3.0.3: normalized package name match | Debian stable package indexes: libapt-pkg-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | development files for APT's libapt-pkg and libapt-inst
- Debian apt - libapt-pkg-doc - 3.0.3: normalized package name match | Debian stable package indexes: libapt-pkg-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | documentation for APT development
- Debian apt - libapt-pkg7.0 - 3.0.3: normalized package name match | Debian stable package indexes: libapt-pkg7.0 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | package management runtime library
- Nix - apt: normalized package name match | nixpkgs package indexes: pkgs/by-name/ap/apt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - apt - 2.7.14build2: normalized package name match | Ubuntu 24.04 LTS package indexes: apt from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | commandline package manager
- Ubuntu apt - apt-doc - 2.7.14build2: normalized package name match | Ubuntu 24.04 LTS package indexes: apt-doc from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | documentation for APT
- Ubuntu apt - apt-transport-https - 2.7.14build2: normalized package name match | Ubuntu 24.04 LTS package indexes: apt-transport-https from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | transitional package for https support
- Ubuntu apt - apt-utils - 2.7.14build2: normalized package name match | Ubuntu 24.04 LTS package indexes: apt-utils from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | package management related utility programs
- Ubuntu apt - libapt-pkg-dev - 2.7.14build2: normalized package name match | Ubuntu 24.04 LTS package indexes: libapt-pkg-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | development files for APT's libapt-pkg and libapt-inst
- Ubuntu apt - libapt-pkg-doc - 2.7.14build2: normalized package name match | Ubuntu 24.04 LTS package indexes: libapt-pkg-doc from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | documentation for APT development
- Ubuntu apt - libapt-pkg6.0t64 - 2.7.14build2: normalized package name match | Ubuntu 24.04 LTS package indexes: libapt-pkg6.0t64 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | package management runtime library
- apk - apt - 3.2.0-r0: normalized package name match | Alpine Linux edge package indexes: apt from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | APT package management tool | https://salsa.debian.org/apt-team/apt


## 相关链接

- [Package publisher tools](https://pkg.so/zh-hans/package-publishers/) - Belongs to a package publishing or registry command family.
- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [openssl@3](https://pkg.so/zh-hans/brew/openssl-3/) - Runtime dependency declared by Homebrew.
- [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.
- [bzip2](https://pkg.so/zh-hans/brew/bzip2/) - Runtime dependency declared by Homebrew.
- [perl](https://pkg.so/zh-hans/brew/perl/) - Runtime dependency declared by Homebrew.
- [gettext](https://pkg.so/zh-hans/brew/gettext/) - Build dependency declared by Homebrew.
- [cmake](https://pkg.so/zh-hans/brew/cmake/) - Build dependency declared by Homebrew.
- [libxslt](https://pkg.so/zh-hans/brew/libxslt/) - Build dependency declared by Homebrew.
- [doxygen](https://pkg.so/zh-hans/brew/doxygen/) - Build dependency declared by Homebrew.
- [dpkg](https://pkg.so/zh-hans/brew/dpkg/) - Shares pkgdb curated category or tags: cli, debian, package-manager, system.
- [apt-dater](https://pkg.so/zh-hans/brew/apt-dater/) - Shares pkgdb curated category or tags: apt, cli, debian, system.
- [aptly](https://pkg.so/zh-hans/brew/aptly/) - Shares pkgdb curated category or tags: apt, cli, debian, system.
- [meta-package-manager](https://pkg.so/zh-hans/brew/meta-package-manager/) - Shares pkgdb curated category or tags: cli, package-manager, system.
- [bbrew](https://pkg.so/zh-hans/brew/bbrew/) - Shares pkgdb curated category or tags: cli, package-manager, system.
- [taproom](https://pkg.so/zh-hans/brew/taproom/) - Shares pkgdb curated category or tags: cli, package-manager, system.
- [debianutils](https://pkg.so/zh-hans/brew/debianutils/) - Shares pkgdb curated category or tags: cli, debian, system.
- [posh](https://pkg.so/zh-hans/brew/posh/) - Shares pkgdb curated category or tags: cli, debian, system.
- [kmod](https://pkg.so/zh-hans/brew/kmod/) - Local package facts share a topical domain. Shared terms: cli, compat, openssl, openssl-3, system.
- [systemd](https://pkg.so/zh-hans/brew/systemd/) - Local package facts share a topical domain. Shared terms: cli, lz4, manager, openssl, openssl-3.

## Combined YAML source

View the package source record on GitHub. [combined/apt.yml](https://github.com/mxcl/pkgdb/blob/main/combined/apt.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
