Install go1.1 official version in Ubuntu12.04server64 bit

Source: Internet
Author: User
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

    1. Tell the system where go will be installed (this article is $HOME/go )
    2. Find the corresponding platform file, download the Go package
    3. Unzip & put it in there

Complete! Green Software!

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.