Ubuntu升级go版本

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 

你可能感兴趣的:(go)