centospackeroraclelinux

packer command run with sudo -E does not work


I installed packer on centos and ran "sudo -E packer version" and the command got stuck until I killed it with ctrl+C

However, I don't get this issue with Ubuntu or when running without sudo

issue seems to be happening with RedHat Linux Builds including Oracle Linux and CentOS, I disabled SELinux but still did not work I downloaded earlier version of packer 1.6, did not work I tried with terraform (sudo terraform version it WORKED) Only running Packer with "sudo packer" in Redhat family that does not work

And I need to run it in Oracle Linux.


Solution

  • There used to be a conflict for packer on RHEL.

    #packer on redhat/oracle linux/centos
    /usr/share/cracklib/pw_dict.pwd: Permission denied
    /usr/share/cracklib/pw_dict: Permission denied
    

    The solution I used was this:

    Invoke the packer binary using the absolute path /usr/local/packer or symlink with a different name packer.io

    Best of luck!