Terraform 是一个开源基础设施即代码软件工具,使您能够安全且可预测地创建、更改和改进基础设施。
步骤 1. 首先,通过apt
在终端中运行以下命令确保所有系统包都是最新的。
sudo apt update sudo apt upgrade
步骤 2. 在 Ubuntu 20.04 上安装 Terraform。
curl
在终端 shell 上运行以下命令,将 Terraform 的 GPG 密钥添加到系统中:
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
然后,运行以下命令从 Hashicorp 网站下载 Terraform:
sudo apt-add-repository \"deb [arch=$(dpkg --print-architecture)] https://apt.releases.hashicorp.com $(lsb_release -cs) main\"
添加存储库后,通过运行以下命令安装 Terraform:
sudo apt update sudo apt install terraform
要安装 Terraform,只需使用以下命令:
sudo apt install snapd sudo apt update sudo snap install terraform --candidate
安装完成后,您可以使用以下命令验证已安装的 Terraform 版本:
terraform -v
恭喜!您已成功安装 Terraform。感谢您使用本教程在 Ubuntu 20.04 LTS Focal Fossa 系统上安装 Terraform 自动化工具。如需其他帮助或有用信息,我们建议您查看Terraform 官方网站。