A detailed tutorial on installing the Go language on a Linux system

Source: Internet
Author: User
Tags install go linux mint

This article mainly introduced in the Linux system to install the Go language detailed tutorial, because many people in the country blindly sought after Google, resulting in the go language in the domestic popularity far beyond foreign ... Need friends can refer to the following

Go (also known as "Golang") is a programming language originally developed by Google. It has several design principles since its birth: simplicity, security, and speed. The go language release has a variety of debugging, testing, tuning, and code review tools. Now the Go language and its tool chains are available in most Linux distribution base warehouses and can be installed with the default Package manager.

Install the Go language on Ubuntu, Debian, or Linux mint

The following is the use of apt-get on a Debian-based distribution to install the Go language and its development tools.

?

1 $ sudo apt-get install Golang

Check the Go language version to verify the installation.

?

1 2 3 $ go version go version go1.2.1 linux/amd64

Depending on your needs, you may want to use Apt-get to install additional go tools.

?

1 $ sudo apt-cache search Golang

Install the go language in Fedora and Centos/rhel

The following command installs the Go language and its tools in the distribution based on Red Hat.

?

1 $ sudo yum install Golang

Check the Go language version to verify the installation.

?

1 2 3 $ go version go version go1.3.3 linux/amd64

Depending on your needs, you may want to use Yum to install additional go tools.

?

1 $ yum Search Golang

Install go language from official website

Sometimes the go language version in the release is not up to date. To avoid this, you can install the latest go language from the official website. Here is the step.

Enter the official source of the Go language, and download the precompiled binary code.

For 64-bit Linux:

?

1 $ wget https://storage.googleapis.com/golang/go1.4.1.linux-amd64.tar.gz

For 32-bit Linux:

?

1 $ wget https://storage.googleapis.com/golang/go1.4.1.linux-386.tar.gz

Install the program under/usr/local

?

1 $ sudo tar-xzf go1.4.1.linux-xxx.tar.gz-c/usr/local

Add the system-wide PATH environment variable to the/etc/profile.

?

1 2 3 $ sudo vi/etc/profile export path= $PATH:/usr/local/go/bin

If you install go in a custom location other than/usr/local, you will also need to set the GOROOT environment variable to point to the custom installation location.

?

1 2 3 $ sudo vi/etc/profile export goroot=/path/to/custom/location

Check the version of the Go language

?

$ go V Ersion   Go version go1.4.1 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.