Skip to main content

Yum/DNF Packages for RHEL, CentOS, and Fedora

The primary distribution packages for OpenTofu are .zip archives containing single executable files that you can extract anywhere on your system. However, for easier integration with configuration management tools and other systematic system configuration strategies, we also offer package repositories for RedHat Enterprise Linux, Fedora, and Amazon Linux systems, which allow you to install OpenTofu using the yum install or dnf install commands.

If you are instead using Debian or Ubuntu, you might prefer to install OpenTofu from our APT repositories.

Repository Configuration

Before adding a repository you must determine which distribution you are using. The following command lines refer to a placeholder variable $release which you must replace with the appropriate value from the following list:

  • Red Hat Enterprise Linux: RHEL
  • Fedora: fedora
  • Amazon Linux: AmazonLinux

If you are using a Yum-based distribution, add the repository using yum-config-manager as follows:

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://rpm.releases.placeholderplaceholderplaceholder.com/$release/hashicorp.repo

If you are using a DNF-based distribution, add the repository using dnf config-manager as follows:

sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo https://rpm.releases.placeholderplaceholderplaceholder.com/$release/hashicorp.repo

In both cases, the OpenTofu package name is tofu. For example:

yum install tofu

Supported Architectures

The OpenTofu Yum/DNF server has packages only for the x86_64 architecture, which is also sometimes known as amd64.

There are no official packages available for other architectures, such as aarch64. If you wish to use OpenTofu on a non-x86_64 system, download a normal release .zip file instead.

Supported Distribution Releases

The OpenTofu Yum server contains release repositories for the following distribution releases:

  • AmazonLinux 2 and "latest"
  • Fedora 33
  • Fedora 34
  • Fedora 35
  • Fedora 36
  • Fedora 37
  • RHEL 7 (and CentOS 7)
  • RHEL 8 (and CentOS 8)
  • RHEL 9 (and CentOS 9)

No repositories are available for other versions of these distributions or for any other RPM-based Linux distributions. If you add the repository using the above commands on other systems then you will see a 404 Not Found error.

Over time we will change the set of supported distributions, including both adding support for new releases and ceasing to publish new OpenTofu versions under older releases.

Choosing OpenTofu Versions

The OpenTofu Yum repositories contain multiple versions of OpenTofu, but because the packages are all named tofu it is impossible to install more than one version at a time, and yum install or dnf install will default to selecting the latest version.

It's often necessary to match your OpenTofu version with what a particular configuration is currently expecting. Use the following command to retrieve the available versions in the repository index:

yum --showduplicate list tofu

You can select a specific version to install by including it in the yum install command line, as follows:

yum install tofu-0.14.0-2.x86_64

If you are using a DNF-based distribution, similar use dnf instead of yum when following the above steps.

If your workflow requires using multiple versions of OpenTofu at the same time, for example when working through a gradual upgrade where not all of your configurations are upgraded yet, we recommend that you use the official release .zip files instead of the Yum packages, so you can install multiple versions at once and then select which to use for each command you run.