Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Packer installation Issues on EC2 Amazon AMI Linux distribution

I am having issues installing packer onto the EC2 machine. I have downloaded the Linux packer binary file on my Windows PC and uploaded it to the instance. I put it into the directory ~/packer_new, and have been trying two different ways for adding it to the path because it produces this error:

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

When I run just the packer command.

On the packer website, it states

To fix this, you can create a symlink to packer that uses a different name like packer.io, or invoke the packer binary you want using its absolute path, e.g. /usr/local/packer.

I have done the first part by creating a symbolic link using this command:

sudo ln -s packer_new/packer /usr/bin/packer.io

And when I run the packer command again, it still produces the same error. Am I supposed to be running a different command?

And the second way is to add the path to ~/.bash_profile:

export PATH=$PATH:~/packer_new/

Note that I also have another PATH variable in the bash_profile for bin: PATH=$PATH:$HOME/.local/bin:$HOME/bin, not sure if this will affect setting PATH to packer...

But by adding the path, it also produces the same error when running packer.

How can I fix this?

One more question, what does it mean when they say:

invoke the packer binary you want using its absolute path, e.g. /usr/local/packer.

like image 528
J. H Avatar asked May 28 '26 11:05

J. H


1 Answers

And when I run the packer command again, it still produces the same error. Am I supposed to be running a different command?

Run packer.io and you link command is wrong. You should do sudo ln -s $HOME/packer_new/packer /usr/bin/packer.io

And the second way is to add the path to ~/.bash_profile: export PATH=$PATH:~/packer_new/

You have to put the path to the front of the PATH. I.e.

export PATH=$HOME/packer_new:$PATH

invoke the packer binary you want using its absolute path, e.g. /usr/local/packer.

It means that you can always run with the absolute path. In your case $HOME/packer_new/packer.

like image 176
Rickard von Essen Avatar answered May 31 '26 05:05

Rickard von Essen