This is a creation in Article, where the information may have evolved or changed.
Unzip
Tar zxvf go1.2.2.linux-amd64.tar.gz
Move (to have root privileges)
MV Go/usr/local/go
Root permission is required for all of the following
1.Ubuntu 14.04 Install a go Lang (go language)
1.1 Setting System environment variables
Vi/etc/profile
At the end of the add (press I key to enter the editing state, put the cursor down the last, add the following, and finally press: Wq key to save the exit, where: q! is not saved forced exit)
Export Goroot=/usr/local/go
Export gobin= $GOROOT/bin
Export gopkg= $GOROOT/pkg/tool/linux_amd64
Export GOARCH=AMD64
Export Goos=linux
Export path=.: $PATH: $GOBIN: $GOPKG
1.2 Compile to make it effective
Source/etc/profile
1.3 Testing
If you can see the version number, then the configuration is successful!
Go version
Go version go1.2.2 linux/amd64
1.4 Other git and mercurial installations
sudo apt-get install git
sudo apt-get install mercurial
Found in use, if you do not install the above two, you have to manually download some files
2.CentOS 6.5 Install Go Lang (Go language)
2.1 Setting System Environment variables
Vi/etc/profile
At the end of the add (press I key to enter the editing state, put the cursor down the last, add the following, and finally press: Wq key to save the exit, where: q! is not saved forced exit)
Export Goroot=/usr/local/go
Export gobin= $GOROOT/bin
Export gopkg= $GOROOT/pkg/tool/linux_amd64
Export GOARCH=AMD64
Export Goos=linux
Export path=.: $PATH: $GOBIN: $GOPKG
2.2 Compile to make it effective
Source/etc/profile
2.3 Testing
If you can see the version number, then the configuration is successful!
Go version
Go version go1.2.2 linux/amd64