The latest version of Ubuntu Golang installation Tutorial

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

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.