跳至主要内容

在 Alpine Linux 上安装 OpenTofu

OpenTofu 在 Alpine Linux 测试版存储库GitHub 发行版页面 中以 .apk 包的形式提供。

使用安装程序安装

您可以使用 OpenTofu 安装程序脚本运行安装。

代码块
# Download the installer script:
curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh
# Alternatively: wget --secure-protocol=TLSv1_2 --https-only https://get.opentofu.org/install-opentofu.sh -O install-opentofu.sh

# Give it execution permissions:
chmod +x install-opentofu.sh

# Please inspect the downloaded script

# Run the installer:
./install-opentofu.sh --install-method apk

# Remove the installer:
rm -f install-opentofu.sh

安装 .apk

您还可以 下载 .apk 并将其安装在您的 Alpine Linux 上。下载后,您可以安装 .apk

代码块
apk add --allow-untrusted tofu_*.apk

从测试版存储库安装

OpenTofu 目前在 Alpine 测试版存储库中可用,并将很快加入 Alpine 稳定版。您可以使用以下命令测试 Alpine 安装。

代码块
echo '@community https://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories
apk add opentofu@community