版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Nick_666/article/details/80193801
sudo apt install golang-go
sudo apt-get install golang-1.9
sudo apt-get remove golang-1.9
sudo apt autoremove
先卸载旧版本
curl -O https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz
$ tar -C /usr/local -zxvf go1.9.linux-amd64.tar.gz
$ mkdir -p ~/go/src
$ echo "export GOPATH=$HOME/go" >> ~/.profile
$ echo "export PATH=$PATH:$GOPATH/bin:/usr/local/go/bin" >> ~/.profile
$ source ~/.bashrc
$ source ~/.profile
$ go version
有疑问加站长微信联系(非本文作者)