# 使用 Homebrew, apk, chocolatey, dnf, Nix, pacman, zypper, scoop, winget 安装 opentofu

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

## 安装

```sh
sudo av install brew:opentofu
```

## 代理安全回答

opentofu plans and applies infrastructure changes from local state and cloud credentials.

- **凭据访问:** Reads backend credentials, provider credentials, variables, and state data.
- **远程变更:** Can create, update, or destroy infrastructure resources.
- **发布/制品风险:** Can deploy infrastructure that exposes or runs application artifacts.
- **推荐控制:** Gate apply, destroy, import, state, and backend changes.
- **代理使用指南:** Allow plan by default; require approval for any state-changing command.

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install opentofu
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add opentofu
```

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

- dnf (92%):

```sh
sudo dnf install opentofu
```

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

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

- pacman (92%):

```sh
sudo pacman -S opentofu
```

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

- zypper (92%):

```sh
sudo zypper install opentofu
```

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

### Windows

- Chocolatey (92%):

```sh
choco install opentofu
```

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

- Scoop (92%):

```sh
scoop install main/opentofu
```

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

- winget (92%):

```sh
winget install --id OpenTofu.Tofu -e
```

  证据: Windows Package Manager source index: OpenTofu.Tofu from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:opentofu
- **软件包管理器:** Homebrew
- **版本:** 1.12.5
- **来源摘要:** Drop-in replacement for Terraform. Infrastructure as Code Tool
- **主页:** <https://opentofu.org/>
- **仓库:** <https://github.com/opentofu/opentofu>
- **最后更新:** 2026-07-27T23:46:52+02:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- tofu (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

OpenTofu is a community-driven infrastructure-as-code tool created as an open-source fork of Terraform after HashiCorp changed Terraform’s license from MPL-2.0 to the Business Source License. It keeps the familiar `plan`, `apply`, state, provider, module, and HCL-style workflows while using the `tofu` executable and Linux Foundation governance.

### 项目历史

The OpenTF manifesto began as an appeal to keep Terraform under a truly open-source license. When that did not happen, the initiative forked the last MPL-licensed Terraform codebase and moved forward as OpenTofu under the Linux Foundation. The project’s own announcement framed OpenTofu as community-driven, impartial, layered, modular, and backward-compatible.

OpenTofu reached its first stable release, 1.6.0, on January 10, 2024, after roughly four months of work. The project documented migration paths from Terraform 1.5.x and 1.6.x and positioned the release as production-ready for users who wanted open-source infrastructure-as-code continuity.

### 采用历史

OpenTofu adoption was unusually fast because it started with Terraform’s established user model, provider ecosystem, and module habits. The Linux Foundation launch announcement named broad community and company backing, while the OpenTofu homepage later described thousands of providers and modules available to users.

The package-manager story matters because OpenTofu’s promise is partly operational: users need a `tofu` binary in CI images, developer laptops, container builds, and distribution repositories. Homebrew, Nix, Alpine, Fedora, Arch, Scoop, Chocolatey, winget, and other package channels made the fork installable without bespoke bootstrapping.

### 使用方式

Operators use OpenTofu to declare infrastructure resources, initialize providers and modules, compute plans, apply changes, manage state, and integrate infrastructure changes into CI/CD. It is intentionally familiar to Terraform users, with migration guides focused on preserving existing workflows and configurations.

The CLI reads configuration files, talks to provider plugins, stores state locally or remotely, and exposes command behavior that infrastructure teams script heavily. That makes packaging details such as executable name, plugin cache behavior, credentials files, and compatibility promises more important than for a throwaway CLI.

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

OpenTofu is one of the clearest examples of licensing changing a package graph. A single upstream license decision created a new binary, new governance, new release channel, and new distro formulas for a tool already embedded in deployment pipelines.

### 时间线

- 2023-08: the OpenTF manifesto objected to Terraform’s license change and proposed an open-source path.
- 2023-09-20: the Linux Foundation announced OpenTofu as an open-source Terraform fork.
- 2024-01-10: OpenTofu 1.6.0 became the first stable release.
- 2024-01-10: the Linux Foundation announced OpenTofu general availability.

### Related projects

- Related projects include Terraform, the OpenTofu provider registry ecosystem, HCL, Terragrunt, Atlantis, Spacelift, env0, and CI/CD systems that run infrastructure plans as part of deployment workflows.

### 来源

- <https://opentofu.org/>
- <https://opentofu.org/blog/opentofu-announces-fork-of-terraform/>
- <https://opentofu.org/blog/opentofu-is-going-ga/>
- <https://opentofu.org/docs/v1.6/intro/migration/terraform-1.6/>
- <https://opentofu.org/manifesto/>
- <https://www.linuxfoundation.org/press/announcing-opentofu>
- <https://www.linuxfoundation.org/press/opentofu-announces-general-availability>


## 安全说明

infrastructure as code tool.

- **Geiger 风险:** orange / 高
- infrastructure as code tool


## 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: ~/.tofurc, $XDG_CONFIG_HOME/opentofu/tofurc
- Windows: %APPDATA%\tofu.rc

## Credential files

- Unix: ~/.terraform.d/credentials.tfrc.json
## 其他软件包管理器记录

- Nix - opentofu: normalized package name match | nixpkgs package indexes: pkgs/by-name/op/opentofu/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - opentofu - 1.12.3-r1: normalized package name match | Alpine Linux edge package indexes: opentofu from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | OpenTofu lets you declaratively manage your cloud infrastructure | https://opentofu.org/
- dnf - opentofu - 1.12.3-1.fc45: normalized package name match | Fedora Rawhide package metadata: opentofu from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | OpenTofu lets you declaratively manage your cloud infrastructure | https://github.com/opentofu/opentofu
- pacman - opentofu - 1.12.1-1: normalized package name match | Arch Linux sync databases: opentofu from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Lets you declaratively manage your cloud infrastructure | https://github.com/opentofu/opentofu
- zypper - opentofu - 1.12.5-1.2: normalized package name match | openSUSE Tumbleweed package metadata: opentofu from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Declaratively manage your cloud infrastructure | https://github.com/opentofu/opentofu
- Chocolatey - opentofu: normalized package name match | Chocolatey community package catalog: opentofu from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='9.151999','cports'
- Scoop - main/opentofu: normalized package name match | Scoop official bucket manifest trees: bucket/opentofu.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - OpenTofu.Tofu: normalized package name match | Windows Package Manager source index: OpenTofu.Tofu from https://cdn.winget.microsoft.com/cache/source.msix
- winget - OpenTofu.Tofu.Alpha: normalized package name match | Windows Package Manager source index: OpenTofu.Tofu.Alpha from https://cdn.winget.microsoft.com/cache/source.msix
- winget - OpenTofu.Tofu.Beta: normalized package name match | Windows Package Manager source index: OpenTofu.Tofu.Beta from https://cdn.winget.microsoft.com/cache/source.msix
- winget - OpenTofu.Tofu.RC: normalized package name match | Windows Package Manager source index: OpenTofu.Tofu.RC from https://cdn.winget.microsoft.com/cache/source.msix


## Combined YAML source

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