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

Source: Internet
Author: User
Tags install go mercurial
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

Related Article

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.