Question

I'm trying to build packer from source on ubuntu, but getting the following errors which I'm unsure how to resolve.

go install: no install location for _/home/vagrant/packer/builder/amazon/chroot
go install: no install location for _/home/vagrant/packer/builder/amazon/common
go install: no install location for _/home/vagrant/packer/builder/amazon/ebs
go install: no install location for _/home/vagrant/packer/builder/amazon/instance
go install: no install location for _/home/vagrant/packer/builder/digitalocean
go install: no install location for _/home/vagrant/packer/builder/openstack
go install: no install location for _/home/vagrant/packer/builder/virtualbox
go install: no install location for _/home/vagrant/packer/builder/vmware
go install: no install location for _/home/vagrant/packer/command/build
go install: no install location for _/home/vagrant/packer/command/fix
go install: no install location for _/home/vagrant/packer/command/inspect
go install: no install location for _/home/vagrant/packer/command/validate
go install: no install location for _/home/vagrant/packer/common
go install: no install location for _/home/vagrant/packer/common/command
go install: no install location for _/home/vagrant/packer/common/json
go install: no install location for _/home/vagrant/packer/communicator/ssh
go install: no install location for _/home/vagrant/packer/packer
go install: no install location for _/home/vagrant/packer/packer/plugin
go install: no install location for _/home/vagrant/packer/packer/rpc
go install: no install location for _/home/vagrant/packer/post-processor/vagrant
go install: no install location for _/home/vagrant/packer/provisioner/chef-solo
go install: no install location for _/home/vagrant/packer/provisioner/file
go install: no install location for _/home/vagrant/packer/provisioner/puppet-masterless
go install: no install location for _/home/vagrant/packer/provisioner/salt-masterless
go install: no install location for _/home/vagrant/packer/provisioner/shell
make: *** [all] Error 1

I've tried adding a few of the above directories to my GOPATH, but still get all the same errors above.

$ echo $GOPATH 
/home/vagrant/packer:/home/vagrant/packer/builder/amazon/chroot
Was it helpful?

Solution

GOPATH does not work like you assume: It is not a list of paths to look for your code you are trying to build but a path to your Go workspace. Please read http://golang.org/doc/code.html#Organization first. Your GOPATH must contain src, bin and pkg directories, otherwise it is not a workspace.

What the error message is trying to tell you: There is no pkg directory under your GOPATH, so the go tool cannot install what it is trying to build.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top