ubuntu安装go
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
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。