您好,登录后才能下订单哦!
密码登录
登录注册
点击 登录注册 即表示同意《亿速云用户服务条款》
现在地址: https://golang.google.cn/dl/
go1.11.2.linux-amd64.tar.gz
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
查看内核版本命令:
[root@localhost ~]# cat /proc/version
inux version 3.10.0-862.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) ) #1 SMP Fri Apr 20 16:44:24 UTC 2018
[root@localhost ~]#
[root@localhost ~]# uname -r
3.10.0-862.el7.x86_64
注意:用root账号安装
依次执行如下命令:
cd /opt
mkdir app
cd app
tar -C /opt/app/ -zxvf go1.11.2.linux-amd64.tar.gz
cd /opt
mkdir goWork
在/etc/profile文件尾部添加:
vim /etc/profile
export GOROOT=/opt/app/go
export GOBIN=$GOROOT/bin
export PATH=$PATH:$GOBIN
export GOPATH=/opt/goWork
:wq保存
使其生效:source /etc/profile
执行命令:go version
go version go1.11.2 linux/amd64
执行命令:go env
GOARCH="amd64"
GOBIN="/opt/app/go/bin"
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/opt/goWork"
GOPROXY=""
GORACE=""
GOROOT="/opt/app/go"
GOTMPDIR=""
GOTOOLDIR="/opt/app/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build871203888=/tmp/go-build -gno-record-gcc-switches"
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。