1、在Golang中国网站下载Golang最新版压缩包如:go1.9.2.linux-amd64.tar.gz
2、将压缩包解压到/opt目录:
sudo tar zxvf go1.9.2.linux-amd64.tar.gz -C /opt/
3、创建Golang工程目录(GOROOT):
sudo mkdir ~/codes/go
4、使用Vim或者Gedit编辑/etc/profile文件添加环境变量:
sudo gedit /etc/profile
5、添加环境变量:
export GOROOT=/opt/go
export GOPATH=/root/codes/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
6、使环境变量生效:
sudo source /etc/profile
解决Ubuntu下sublime text3不能输入中文的问题
参考文章:
https://jingyan.baidu.com/article/f3ad7d0ff8731609c3345b3b.html
https://www.sinosky.org/linux-sublime-text-fcitx.html
扫描二维码关注公众号,回复:
3181197 查看本文章