zhang_gq · 2018-03-27 18:33:05 · 5222 hits · Estimated reading time 1 minute · 18 minutes ago Start browsing
This is an article created at 2018-03-27 18:33:05, the information in it may have been developed or changed.
Centos executes yum install golang, the installed go version is 1.8
# go version
go version go1.8.3 linux/amd64
If you have installed go with yum, you can delete it with the following command
rm -rf /usr/bin/go
rm -rf /etc/alternatives/go
rm -rf /usr/lib/golang
If you want to install version 1.9 or higher, you must first download the official tar package, as follows:
https://storage.googleapis.com/golang/go1.9.4.linux-amd64.tar.gz
If you can’t access it, you can download https://download.csdn.net/download/zhang_gq/10311792 from CSDN
Upload the tar package to Centos, and then refer to the operation command:
# tar -C /root -xzf go1.9.4.linux-amd64.tar.gz
# cd /root; vi ~/.bashrc
export GOPATH=/root/Go
export GOROOT=/root/go
export PATH=$PATH:$GOROOT/bin
# source ~/.bashrc
# go version
go version go1.9.4 linux/amd64
Recommended Posts