Ubuntu 14.04/centos 6.5 installs Go LANG (go language)

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Get the source list address and choose the one that suits your system (my is go1.3.1.linux-amd64.tar.gz)

http://golang.org/dl/

Unzip
Tar zxvf go1.3.1.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/goexport gobin= $GOROOT/binexport gopkg= $GOROOT/pkg/tool/linux_amd64export GOARCH= Amd64export goos=linuxexport 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 gitsudo 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/goexport gobin= $GOROOT/binexport gopkg= $GOROOT/pkg/tool/linux_amd64export GOARCH= Amd64export goos=linuxexport 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

3. Source code compilation and installation (general)

Read this article: http://my.oschina.net/fishman/blog/121915

A few additional explanations

3.1 Download speed is very slow, and sometimes can not download

You know. [by the Wall].

3.2 Only install the following to

sudo apt-get install gitsudo apt-get Install mercurial

3.3 When the environment variable is added, it takes effect immediately without restarting

SOURCE ~/.BASHRC



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.