您好,登錄后才能下訂單哦!
現在地址: 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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。