This is a creation in Article, where the information may have evolved or changed.
I believe that the students who intend to install Golang have already seen a lot of installation tutorials, there are two main ways of online, one is
<span style= "FONT-SIZE:14PX;" > sudo apt-get install golang-go</span>
Simple violence, but because now a lot of Golang library has asked >1.1, and Apt-get installed is 1.02, it is recommended to install the latest version of Golang, so recommended manual installation, the tutorial itself is not a problem, but for some special reasons, May cause the installation to fail even in inexplicable magical places. After a noon in the card, I still write down the summary of this article to pay attention to the place.
Take the Ubuntu wiki installation tutorial as an example:
- Install the GCC tool, because golang some of the features are written in C, so building a Golang compilation is a must
$ sudo apt-get install Bison gawk gcc Libc6-dev make
- Install the mercurial tool to use the HG command to extract the source code of the Golang
$ sudo apt-get install mercurial
- Pick and extract, if your network speed is slow, this step will take a little more time
$ HG Clone-r Release Https://go.googlecode.com/hg/go
To this step we all understand, googlecode difficult to connect, so do not use a special method of the word clone don't know how long, so decisively avoid him.
It's good to download the latest package from the official download point (http://golang.org/dl/).
after decompression, enter the directory, compiling Golang
$ cd go/src$./all.bash
It was supposed to be all right, but here I am. Checking API C Ompatibility was stuck there. Studied what the next Run.bash actually did, the original
Attempting to use the previously installed Hg tool, also known as mercurial, did a version check ... All right, just delete him ...
$ sudo apt-get remove mercuial
It's all in the local operation, and there's no problem.
$GOBIN Golang Bin directory, here is ~/go/bin here is a configuration example: please pay special attention to the configuration of $goos and $GOARCH
$ gedit ~/.BASHRC
Then join
Export Goroot=~/goexport goarch=386export goos=linuxexport gobin= $GOROOT/bin/export gotools= $GOROOT/pkg/tool/export Path= $PATH: $GOBIN: $GOTOOLS