Skip to content
Cloudbricks.dev logo

How to Setup Packer

Installing Packer on Rocky Linux from the HashiCorp RPM repository, including the cracklib conflict that breaks the default package.

Kishore 1 min read

What is Packer?

Packer builds identical machine images for multiple platforms from a single source template. That makes it a good fit for golden images in an image pipeline — build once, deploy the same artifact everywhere.

This post covers installing Packer on Rocky Linux and verifying the setup.

Install Packer

The cracklib conflict

On RHEL-based distributions, Packer’s RPM collides with the packer library shipped by cracklib, which is already installed. The transaction fails with a file conflict.

The workaround is to unlink the conflicting binary, then reboot:

unlink /usr/sbin/packer

Log in to the code server as root and install the repository tools:

yum install -y yum-utils

Installing yum-utils

Add the HashiCorp repository:

yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

Adding the HashiCorp repository

Install Packer:

sudo yum -y install packer

Installing Packer

Verify the installation:

packer version

Verifying the Packer version