从源代码安装Go到自定义前缀

huangapple go评论81阅读模式
英文:

Install Go from source to custom prefix

问题

我在/usr目录下安装了一个旧版本的Go(使用yum)。如果我从Golang网站下载源代码并运行all.bash,二进制文件和库将安装在下载的目录中。

使用通常的Makefile,可以很容易地设置PREFIX,这个设置可以在all.bash文件的某个地方完成吗?

英文:

I have a Go installation in /usr, which is old (yum). If I download the source from the Golang site and run the all.bash, the binaries and libraries are installed in the downloaded dir.

With a usual Makefile, it's easy to set PREFIX, can this be done in the all.bash file somewhere?

答案1

得分: 1

只要你设置了GOPATH并将$GOROOT/bin添加到你的路径中,你就不需要在任何地方“安装”它。

export PATH="$PATH:/usr/src/go/bin"
英文:

You don't need to "install" it anywhere as long as you have GOPATH set and add $GOROOT/bin to your path.

export PATH="$PATH:/usr/src/go/bin"

huangapple
  • 本文由 发表于 2014年10月3日 03:09:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/26167850.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定