$ sudo apt-get install bison gawk gcc libc6-dev make安裝mercurial工具,用於提取golang的源代碼
$ sudo apt-get install mercurial提取golang的原代碼
$hg clone -r release https://go.googlecode.com/hg/ go編輯源代碼
$ cd go/src $ ./all.bash
配置環境變量 linux
$ gedit ~/.bashrc在.bashrc環境變量中加入golang配置
export GOROOT=~/go export GOARCH=386 export GOOS=linux export GOBIN=$GOROOT/bin/ export GOTOOLS=$GOROOT/pkg/tool/ export PATH=$PATH:$GOBIN:$GOTOOLS使用.bashrc當即生效
source ~/.bashrc