# 使用 Homebrew, apk, dnf, Nix, pacman 安装 cargo-deny

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

## 安装

```sh
sudo av install brew:cargo-deny
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install cargo-deny
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add cargo-deny
```

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

- dnf (92%):

```sh
sudo dnf install cargo-deny
```

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

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

- pacman (92%):

```sh
sudo pacman -S cargo-deny
```

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

## 软件包事实

- **软件包键:** brew:cargo-deny
- **软件包管理器:** Homebrew
- **版本:** 0.20.2
- **来源摘要:** Cargo plugin for linting your dependencies
- **主页:** <https://github.com/EmbarkStudios/cargo-deny>
- **仓库:** <https://github.com/EmbarkStudios/cargo-deny>
- **最后更新:** 2026-07-09T22:03:47Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- cargo-deny (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

cargo-deny is an Embark Studios Cargo plugin for linting Rust dependency graphs. It checks advisories, license policy, banned crates, duplicate versions, and allowed package sources from a project-level deny.toml file.

### 项目历史

Embark Studios created the repository and published the crate in May 2019. The README frames cargo-deny as an open-source release of a tool Embark uses internally, with a dedicated book for in-depth documentation.

The project grew into one of the standard Rust dependency-policy tools, with docs organized around checks for licenses, bans, advisories, and sources. Its repository topics and README both present it as a Cargo subcommand for dependency linting.

### 采用历史

cargo-deny has broad adoption for Rust CI because it covers policy decisions that Cargo itself intentionally does not enforce: which licenses are acceptable, whether multiple versions are allowed, whether vulnerable advisories should fail builds, and which registries or git sources are trusted.

The tool is packaged in apk, Homebrew, dnf, Nix, and pacman, and crates.io metadata shows more than four million downloads by June 2026. The README also points to cargo-deny-action for GitHub Actions use.

### 使用方式

The quickstart is `cargo install --locked cargo-deny && cargo deny init && cargo deny check`. The init command creates a deny.toml template in the current working directory unless a path is supplied.

Users commonly run `cargo deny check` in CI, or run targeted checks such as `cargo deny check licenses`, `cargo deny check bans`, `cargo deny check advisories`, and `cargo deny check sources`.

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

cargo-deny is package-nerd infrastructure because it makes dependency policy executable. Instead of tracking license allowlists, source restrictions, duplicate-version rules, and advisories in prose, teams can encode them in deny.toml and fail builds consistently.

It is also an example of Cargo's external-tool model handling ecosystem governance concerns without bloating Cargo itself.

### 时间线

- 2019: GitHub repository created and first crates.io publication recorded.
- 2019-2020: Early 0.6.x tags show rapid iteration on dependency linting.
- 2024-2026: Release stream continues through 0.19.x.
- 2026: crates.io metadata shows more than four million downloads and version 0.19.9 current in the sampled registry data.

### Related projects

- cargo-deny-action packages cargo-deny for GitHub Actions workflows.
- RustSec advisory data is part of the broader ecosystem behind advisory checking.
- SPDX license identifiers and license lists are central to the licenses check documented by cargo-deny.

### 来源

- <https://api.github.com/repos/EmbarkStudios/cargo-deny>
- <https://crates.io/api/v1/crates/cargo-deny>
- <https://embarkstudios.github.io/cargo-deny>
- <https://github.com/EmbarkStudios/cargo-deny#readme>
- <https://github.com/EmbarkStudios/cargo-deny/blob/main/docs/src/cli/init.md>


## 安全说明

没有找到 cargo-deny 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。



## 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: <cwd>/deny.toml
## 其他软件包管理器记录

- Nix - cargo-deny: normalized package name match | nixpkgs package indexes: pkgs/by-name/ca/cargo-deny/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - cargo-deny - 0.19.8-r0: normalized package name match | Alpine Linux edge package indexes: cargo-deny from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Cargo plugin for linting your dependencies | https://github.com/EmbarkStudios/cargo-deny
- dnf - cargo-deny - 0.19.9-2.fc45: normalized package name match | Fedora Rawhide package metadata: cargo-deny from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Cargo plugin to help you manage large dependency graphs | https://crates.io/crates/cargo-deny
- pacman - cargo-deny - 0.20.2-1: normalized package name match | Arch Linux sync databases: cargo-deny from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Cargo plugin for linting your dependencies | https://github.com/EmbarkStudios/cargo-deny


## 相关链接

- [cargo-deny](https://pkg.so/zh-hans/pkg/cargo/cargo-deny/) - Same normalized package name exists in another local package ecosystem.

## Combined YAML source

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


## 来源

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