Official steps to install packer on AmazonLinux:
$ yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
Install packer...
Loaded plugins: ovl, priorities
adding repo from: https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
grabbing file https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo to /etc/yum.repos.d/hashicorp.repo
repo saved to /etc/yum.repos.d/hashicorp.repo
$ yum -y install packer
Loaded plugins: ovl, priorities
https://rpm.releases.hashicorp.com/AmazonLinux/latest/x86_64/stable/repodata/c9af8a3098909c94bfa713605005bdec92ba7a29-primary.xml.gz: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
https://rpm.releases.hashicorp.com/AmazonLinux/latest/x86_64/stable/repodata/c9af8a3098909c94bfa713605005bdec92ba7a29-primary.xml.gz: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
One of the configured repositories failed (Hashicorp Stable - x86_64),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
...
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=hashicorp.skip_if_unavailable=true
failure: repodata/c9af8a3098909c94bfa713605005bdec92ba7a29-primary.xml.gz from hashicorp: [Errno 256] No more mirrors to try.
https://rpm.releases.hashicorp.com/AmazonLinux/latest/x86_64/stable/repodata/c9af8a3098909c94bfa713605005bdec92ba7a29-primary.xml.gz: [Errno 14] HTTPS Error 404 - Not Found