This is a creation in Article, where the information may have evolved or changed.
Update
The official version of go1.1 has been released around 10 o'clock Beijing time on May 14.
From the Google website go download page to find the corresponding package, I here is linux64 bit, so i download go1.1.linux version
This document is referenced from the official manual
Determine the environment
Go reads environment variables at run time, such as unread to related environment variables, run by default value
For example, the ${GOROOT}
installation location, if not set correctly, causes the runtime not to find the corresponding file
The. bashrc file under Home directory (~) finally added the following $ VI. BASHRC#GO installation location Export goroot= $HOME/go# similar workspace export gopath= $HOME/mygo# Add Bin directory to environment variable export path=${path}:${gopath}/bin: $GOROOT/bin# declaration 32-bit or 64-bit export goarch=amd64# declares the operating system type export goos= Linuxsource, make the above newly set environment effective $ source. BASHRC
Download installation
I have saved each Golang version in the Golang directory, can be easily switched use (currently has 1.0.3 and 1.1 more commonly used)
If Goroot is pointing to $home/golang/go, go is already installed because I want to use multiple versions, so one more step $ cd ~$ mkdir golang$ cd golang$ wget http://go.googlecode.com/ files/go1.1.linux-amd64.tar.gz$ tar zxf go1.1rc1.linux-amd64.tar.gz if Goroot is pointing to $home/golang/go, go is already installed because I want to use multiple versions , so one more step I first changed the name by version $ MV Go go1.1$ CD ~ Make a soft connection to match the previous section of "Goroot= $HOME/go" $ ln-s golang/go1.1 Gogo installed, test the GO version if you see "Go vers Ion go1.1 Linux/amd64 "indicates success
I'm going to be a 1.0.3.
$ ln-s golang/go1.0.3 go$ wget http://go.googlecode.com/files/go1.0.3.linux-amd64.tar.gz$ tar zxf go1.0.3.linux-amd64.tar.gz$ MV Go go1.0.3 above a few lines means download good and unzip well, now start switching $ cd ~ Remove the soft connection to go1.1 Delete $ rm go to point a new connection to 1.0.3$ Ln-s golang/ go1.0.3 Gogo installed, test it. If "Go version go1.0.3" is displayed, the installation and switch is successful
And then.... No, then, it's installed! I thought it was more complicated, cut!
Summarize
Actually install go1.1 or other versions, as long as
- Tell the system where go will be installed (this article is
$HOME/go
)
- Find the corresponding platform file, download the Go package
- Unzip & put it in there
Complete! Green Software!