1,源码编译
apt-get update;
apt-get install -y gcc libc6-dev;apt-get install -y mercurial;
apt-get install -y git;
hg clone -u release https://code.google.com/p/go;
cd go/src && ./all.bash;
2,apt-get 安装
I found a repo that has the latest versions: https://launchpad.net/~duh/+archive/golang/+packages. So basically do:
sudo apt-get install python-software-properties # 12.04
sudo add-apt-repository ppa:duh/golang
sudo apt-get update
sudo apt-get install golang
To confirm:
go version
which outputs in my case (Ubuntu precise)
go version go1.1.1 linux/amd64
From there just export the settings you're gonna need to bash_rc or equivalent:
export GOROOT=/usr/lib/go
export GOBIN=/usr/bin/go
有疑问加站长微信联系(非本文作者)