您的位置:首页 > 编程语言 > Go语言

ubuntu安装go

2014-01-24 11:47 435 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: