# 先卸载旧的golang yum remove golang # 然后找到最新版本 https://golang.google.cn/dl/ # 下载安装 cd /usr/local/src wget https://golang.google.cn/dl/go1.21.1.linux-amd64.tar.gz tar -zxvf go1.21.1.linux-amd64.tar.gz -C /usr/local/ # 增加配置文件 vim /etc/profile export GOROOT=/usr/local/go export PATH=$PATH:$GOROOT/bin export GOPATH=/opt/go export PATH=$PATH:$GOPATH/BIN # 应用改变 source /etc/profile # 查看版本 go version # 依赖下载速度过慢 go env -w GO111MODULE=on go env -w GOPROXY=https://goproxy.cn,direct
转载至:https://blog.csdn.net/qq_33997198/article/details/118333272
标签:golang,cn,centos7,export,https,go,PATH,最新版 From: https://www.cnblogs.com/betobe/p/18135726