一:linux go 卸载与安装,版本升级
1.下载linnux go新版本
https://studygolang.com/dl
go1.12.5.linux-amd64.tar.gz
2.将旧版本go 安装的根目录删除
查看安装目录:"/root/go"
#go env
GOROOT="/root/go"
删除
#rm -rf /root/go
将下载好的新版本上传到/root/目录下并解压
#cat /etc/profile
export GOROOT=/root/go
export GOPATH=/root/gowork
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
运行 source /etc/profile 让环境变量生效
#source /etc/profile
验证
#go version
二:新环境安装
1.下载并解压
$wget https://dl.google.com/go/go1.10.linux-amd64.tar.gz
$cd /usr/local/
$tar -xzf go1.10.linux-amd64.tar.gz
2.添加go环境变量
echo 'export GOROOT=/usr/local/go' >> /etc/profile
echo 'export PATH=$PATH:$GOROOT/bin'>> /etc/profile
echo 'export GOPATH=/home/usr/local/gowork' >>/etc/profile
echo 'export PATH=$PATH:$GOPATH/bin'>> /etc/profile
3.刷新环境变量
source /etc/profile
4.验证
go version

博客主要介绍了Linux环境下Go语言的相关操作,包括卸载旧版本,需删除旧版本Go安装的根目录;安装新版本,要先下载Linux Go新版本;还提及了新环境安装,但未展开具体内容。
1239

被折叠的 条评论
为什么被折叠?



