# 使用 Homebrew, Nix, apt, scoop 安装 dafny

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

## 安装

```sh
sudo av install brew:dafny
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install dafny
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#dafny
```

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

- Ubuntu apt (92%):

```sh
sudo apt install dafny
```

  证据: Ubuntu 24.04 LTS package indexes: dafny from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz

### Windows

- Scoop (92%):

```sh
scoop install main/dafny
```

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

## 软件包事实

- **软件包键:** brew:dafny
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/dafny>
- **版本:** 4.11.0
- **来源摘要:** Verification-aware programming language
- **主页:** <https://github.com/dafny-lang/dafny/blob/master/README.md>
- **仓库:** <https://github.com/dafny-lang/dafny>
- **上游文档:** <https://github.com/dafny-lang/dafny/blob/master/README.md>
- **许可证:** MIT
- **源码归档:** <https://github.com/dafny-lang/dafny/archive/refs/tags/v4.11.0.tar.gz>
- **最后更新:** 2026-06-22T14:03:07-07:00
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- dafny (cli)
- dafny (别名)

## 依赖

- dotnet@8
- z3

## 构建依赖

- gradle@8
- openjdk

## 安装行为

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

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 4.11.0
- 管理器更新时间: 2026-06-22
- 本地数据: OK
- 上游仓库: https://github.com/dafny-lang/dafny
- 检测到的最新版本: v4.11.0 (当前)
## 项目历史与用法

Dafny is a verification-aware programming language and toolchain. It occupies a special package-manager niche: a single CLI that lets developers write programs, specifications, and proofs together, then verify them and compile to mainstream languages.

### 项目历史

The official Dafny README describes Dafny as a verification-ready programming language whose verifier checks code against specifications while the developer writes. The public dafny-lang/dafny repository was created in 2016, and GitHub release metadata records Dafny 1.9.7 in June 2016.

### 采用历史

Dafny has grown through language documentation, binary releases for common operating systems, a wiki and issue tracker, and editor-centered workflows such as Visual Studio Code installation. Its README also points to tutorials, reference material, a Zulip channel, and a standard library, which are typical signs of a specialist language moving from research use into practical developer workflows.

### 使用方式

Users write Dafny programs with specifications such as preconditions, postconditions, invariants, and proofs; the Dafny verifier checks them, and the compiler can emit C#, Go, Python, Java, or JavaScript. The reference manual is the authoritative source for the language and verification system.

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

Dafny matters in package history because it packages formal methods as an installable developer tool rather than a one-off theorem-proving environment. It gives package managers a concrete artifact for a verification language, including CLI binaries, documentation, and cross-platform releases.

### 时间线

- 2016: Public dafny-lang/dafny GitHub repository is created.
- 2016: Dafny 1.9.7 is published on GitHub releases.
- 2017: Dafny 2.0.0 is published on GitHub releases.
- 2025: Dafny 4.11.0 is published on GitHub releases.

### Related projects

- The official README lists influences including Euclid, Eiffel, CLU, Java, C#, Scala, ML, Coq, and VeriFast, and points to Dafny libraries and editor integrations.

### 来源

- <https://github.com/dafny-lang/dafny>
- <https://raw.githubusercontent.com/dafny-lang/dafny/master/README.md>
- <https://dafny.org/dafny/DafnyRef/DafnyRef>
- <https://github.com/dafny-lang/dafny/releases/tag/v1.9.7>


## 安全说明

generalized runtime or code generation signal.

- **Geiger 风险:** yellow / 中
- generalized runtime or code generation signal

## 源数据库详情

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

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

- Nix - dafny: normalized package name match | nixpkgs package indexes: pkgs/by-name/da/dafny/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - dafny - 2.3.0+dfsg-0.1: normalized package name match | Ubuntu 24.04 LTS package indexes: dafny from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | programming language with program correctness verifier | https://research.microsoft.com/en-us/projects/dafny/
- Scoop - main/dafny: normalized package name match | Scoop official bucket manifest trees: bucket/dafny.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control 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.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [z3](https://pkg.so/zh-hans/brew/z3/) - Runtime dependency declared by Homebrew.
- [dotnet@8](https://pkg.so/zh-hans/brew/dotnet-8/) - Runtime dependency declared by Homebrew.
- [openjdk](https://pkg.so/zh-hans/brew/openjdk/) - Build dependency declared by Homebrew.
- [sby](https://pkg.so/zh-hans/brew/sby/) - Shares pkgdb curated category or tags: cli, developer-tools, formal-methods, formal-verification.
- [cbmc](https://pkg.so/zh-hans/brew/cbmc/) - Shares pkgdb curated category or tags: cli, developer-tools, formal-verification, static-analysis.
- [quint](https://pkg.so/zh-hans/brew/quint/) - Shares pkgdb curated category or tags: cli, developer-tools, formal-methods.
- [alive2](https://pkg.so/zh-hans/brew/alive2/) - Shares pkgdb curated category or tags: cli, developer-tools, formal-methods.
- [esbmc](https://pkg.so/zh-hans/brew/esbmc/) - Shares pkgdb curated category or tags: cli, developer-tools, formal-verification, static-analysis.
- [proof-general](https://pkg.so/zh-hans/brew/proof-general/) - Shares pkgdb curated category or tags: cli, developer-tools, formal-methods.
- [swiftlint](https://pkg.so/zh-hans/brew/swiftlint/) - Shares pkgdb curated category or tags: cli, developer-tools, static-analysis.
- [shellcheck](https://pkg.so/zh-hans/brew/shellcheck/) - Shares pkgdb curated category or tags: cli, developer-tools, static-analysis.
- [statix](https://pkg.so/zh-hans/brew/statix/) - Local package facts share a topical domain. Shared terms: analysis, cli, developer, developer-tools, language.
- [cryptol](https://pkg.so/zh-hans/brew/cryptol/) - Local package facts share a topical domain. Shared terms: cli, developer, developer-tools, formal, formal-methods.

## Combined YAML source

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