ubuntu14.4 安装go16版本

  在linux系统上直接安装go1.4以上版本都会包错: 

    ##### Building Go bootstrap tool.

    cmd/dist

    ERROR: Cannot find /home/go/go1.5/bin/go.

    Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4

      

      为了构建 Go 1.x (x ≥ 5),需要先安装 Go 1.4 到 $GOROOT_BOOTSTRAP. 默认的 $GOROOT_BOOTSTRAP 是 $HOME/go1.4. 我们使用 Go 1.4 作为启动的基础版本来编译工具链。

我们先来看看构建 Go 1.4 是怎么样的:

  1. 使用 gcc 或者 clang 构建 cmd/dist .

  2. 使用 dist、build 编译器工具链(gcc 或者 clang)

  3. NOP

  4. 使用 dist 构建 cmd/go (as go_bootstrap) 

  5. 使用 go_bootstrap 构建其他的标准库和命令

而 Go 1.x (x ≥ 5) 的构建将变成:

  1. 使用 Go 1.4 构建 cmd/dist

  2. 使用 dist 构建编译器工具链

  3. 使用 dist 重新构建编译器工具链

  4. 使用 dist 构建 cmd/go (go_bootstrap) 

  5. 使用 go_bootstrap 构建其他标准库和命令

    先安装go1.4 将$GOROOT_BOOTSTRAP设置到1.4版本的安装路径。在安装1.5版本,使用go version即可查看安装是否成功。

本文出自 “分享” 博客,请务必保留此出处http://huangfu3342.blog.51cto.com/9181639/1854720

文章来自:http://huangfu3342.blog.51cto.com/9181639/1854720
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3