去包安装问题:没有安装位置

时间:2013-10-07 14:36:13

标签: go packer

我正在尝试在ubuntu上从源代码构建packer,但是得到以下错误,我不确定如何解决。

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

我已尝试将上述一些目录添加到我的GOPATH中,但仍然会遇到上述相同的错误。

$ echo $GOPATH 
/home/vagrant/packer:/home/vagrant/packer/builder/amazon/chroot

1 个答案:

答案 0 :(得分:3)

GOPATH不能像你想象的那样工作:不是一个路径列表,用于查找您正在尝试构建的代码,但是是Go工作区的路径。请先阅读http://golang.org/doc/code.html#Organization。您的GOPATH 必须包含srcbinpkg目录,否则它不是工作区。

错误消息试图告诉您:GOPATH下没有pkg目录,因此go工具无法安装它正在尝试构建的内容。