How to Setup Packer
Installing Packer on Rocky Linux from the HashiCorp RPM repository, including the cracklib conflict that breaks the default package.
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
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

Add the HashiCorp repository:
yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

Install Packer:
sudo yum -y install packer

Verify the installation:
packer version

