Bsics: Install HashiCorp Packer on Amazon Linux

Sometimes you can’t avoid using virtual machines. When that happens, it’s best to integrate as much automation as possible to ease maintenance. The goal for years has been to move towards Infrastructure as Code combined with immutable infrastructure. HashiCorp’s Packer has proven to be a useful tool for those working towards those management goals. Packer in an AWS Cloud enables administrators to create customized AMIs by using Packer’s scripting process.

Installation Commands

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
output of first commands
sudo yum -y install packer
output of yum -y install packer command

Verify the Installation

Making sure the install was successful is straight forward. just run

packer

Or, you could also run

packer version

MISC

In some cases, the install might produce an error that returns text like what’s below

/usr/share/cracklib/pw_dict.pwd: Permission denied

/usr/share/cracklib/pw_dict: Permission denied

If that happens, follow the troubleshooting advice on the official HashiCorp page.

https://learn.hashicorp.com/tutorials/packer/get-started-install-cli