我正在从 Vagrantfile 运行以下脚本,一切正常。最后,我看到了go1.10 linux/amd64预期的输出。但是,当我跑步时,vagrant ssh我得到了The program 'go' is currently not installed。govagrant provision that be able to see和vagrant sshthat not able to see之间有什么区别go?config.vm.box = "ubuntu/xenial64"config.vm.provision "shell" do |s| s.inline = " sudo apt-get update export GOPATH=$HOME/work sudo curl -O https://storage.googleapis.com/golang/go1.10.linux-amd64.tar.gz sudo tar -xvf go1.10.linux-amd64.tar.gz sudo mv go /usr/local sudo echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile export PATH=$PATH:/usr/local/go/bin go version" # this row is working fine on the script but not after ssh end
1 回答
ITMISS
TA贡献1871条经验 获得超8个赞
为了使您的更改$PATH
对所有用户可用,您必须在全局配置文件中更改它,而不是用户的。换线
sudo echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile
到
sudo echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile
- 1 回答
- 0 关注
- 79 浏览
添加回答
举报
0/150
提交
取消