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

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

## 安装

```sh
sudo av install brew:rust
```

## 代理安全回答

rust tooling builds binaries and can publish crates through Cargo workflows.

- **凭据访问:** Reads Cargo credentials, Git credentials, environment variables, and project config.
- **远程变更:** Can run build scripts and toolchain commands that call external systems.
- **发布/制品风险:** Can publish crates and release binaries.
- **推荐控制:** Gate cargo publish, install scripts, and credentialed registry access.
- **代理使用指南:** Allow build/test/doc commands; require approval for publish and release automation.

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install rust
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install rust
```

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

### Linux

- apk (92%):

```sh
sudo apk add rust
```

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

- dnf (92%):

```sh
sudo dnf install rust
```

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

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

- pacman (92%):

```sh
sudo pacman -S rust
```

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

- zypper (92%):

```sh
sudo zypper install rust
```

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

- Debian apt (92%):

```sh
sudo apt install cargo
```

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

### Windows

- Chocolatey (92%):

```sh
choco install rust
```

  证据: Chocolatey community package catalog: rust from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','revouninstallerpro'

- Scoop (92%):

```sh
scoop install main/rust
```

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

## 软件包事实

- **软件包键:** brew:rust
- **软件包管理器:** Homebrew
- **版本:** 1.97.1
- **来源摘要:** Safe, concurrent, practical language
- **主页:** <https://www.rust-lang.org/>
- **仓库:** <https://github.com/rust-lang/rust>
- **最后更新:** 2026-07-17T17:57:53Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- cargo (别名)
- cargo-clippy (别名)
- cargo-fmt (别名)
- clippy-driver (别名)
- rust-gdb (别名)
- rust-gdbgui (别名)
- rust-lldb (别名)
- rustc (别名)
- rustdoc (别名)
- rustfmt (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.97.1

## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## 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.


## Credential files

- Unix: ~/.cargo/credentials.toml, ~/.cargo/credentials
## 其他软件包管理器记录

- Nix - rust: normalized package name match | nixpkgs package indexes: rust from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- apk - cargo - 1.97.0-r0: normalized package name match | Alpine Linux edge package indexes: cargo from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | The Rust package manager | https://doc.rust-lang.org/cargo/
- apk - cargo-bash-completions - 1.97.0-r0: normalized package name match | Alpine Linux edge package indexes: cargo-bash-completions from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Bash completions for cargo | https://doc.rust-lang.org/cargo/
- apk - cargo-doc - 1.97.0-r0: normalized package name match | Alpine Linux edge package indexes: cargo-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | The Rust package manager (documentation) | https://doc.rust-lang.org/cargo/
- apk - cargo-zsh-completion - 1.97.0-r0: normalized package name match | Alpine Linux edge package indexes: cargo-zsh-completion from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | ZSH completions for cargo | https://doc.rust-lang.org/cargo/
- apk - rust - 1.97.0-r0: normalized package name match | Alpine Linux edge package indexes: rust from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Rust Programming Language toolchain | https://www.rust-lang.org/
- apk - rust-clippy - 1.97.0-r0: normalized package name match | Alpine Linux edge package indexes: rust-clippy from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Lints to catch common mistakes and improve your Rust code | https://doc.rust-lang.org/clippy/
- apk - rust-clippy-doc - 1.97.0-r0: normalized package name match | Alpine Linux edge package indexes: rust-clippy-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Rust Code Linter (documentation) | https://www.rust-lang.org/
- apk - rust-dbg - 1.97.0-r0: normalized package name match | Alpine Linux edge package indexes: rust-dbg from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Rust Programming Language toolchain (debug symbols) | https://www.rust-lang.org/
- apk - rust-doc - 1.97.0-r0: normalized package name match | Alpine Linux edge package indexes: rust-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Rust Programming Language toolchain (documentation) | https://www.rust-lang.org/
- apk - rust-gdb - 1.97.0-r0: normalized package name match | Alpine Linux edge package indexes: rust-gdb from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | GDB pretty printers for Rust | https://rustc-dev-guide.rust-lang.org/debugging-support-in-rustc.html
- apk - rust-lldb - 1.97.0-r0: normalized package name match | Alpine Linux edge package indexes: rust-lldb from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | LLDB pretty printers for Rust | https://rustc-dev-guide.rust-lang.org/debugging-support-in-rustc.html
- apk - rust-src - 1.97.0-r0: normalized package name match | Alpine Linux edge package indexes: rust-src from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Rust Programming Language toolchain (source code) | https://github.com/rust-lang/rust/tree/1.97.0
- apk - rust-uefi - 1.97.0-r0: normalized package name match | Alpine Linux edge package indexes: rust-uefi from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | UEFI targets for rust | https://rust-osdev.com/uefi-book
- apk - rust-wasm - 1.97.0-r0: normalized package name match | Alpine Linux edge package indexes: rust-wasm from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | WebAssembly targets for rust | https://rust-lang.org/what/wasm/
- apk - rustc-dev - 1.97.0-r0: normalized package name match | Alpine Linux edge package indexes: rustc-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Rust Programming Language toolchain (compiler libraries) | https://www.rust-lang.org/


## Combined YAML source

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


## 来源

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