ubuntu1604 installation go1.13

Operating environment: Tencent cloud server

Download Package

1.13.4 version downloaded from the official website, though note that this address with google, but the actual operation proves, does not need over the wall, but also to download quickly, ha ha.

wget https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz

Add: If you want to install other versions, just change the version number on the list, 1.12.4 pro-test feasible.

Extract to / user / local / after download

tar -C /usr/local -xzf go1.13.4.linux-amd64.tar.gz

Eau, followed with environment variables.

With an environment variable

Open the profile file.

vi /etc/profile

After opening add the following three lines:

export GOROOT=/usr/local/go
export PATH=$PATH:/usr/local/go/bin
export GOPATH=/home/ubuntu/go

After adding the effect is as follows:

explain:

GOROOT file that is obtained after just download and unzip the folder;

Go back by the path which the command PATH, so, go anywhere in the input can be identified;

GOPATH this setting based on individual circumstances, I recommend that you set as the primary folder go below the folder (create yourself), some packets from the back of your github top to bottom, must put $ GOPATH the src folder, this program where to find these packages.

After he profile files execute the following command to bring it into force:

source /etc/profile

Then, the input go env, see output, and configured to successfully install solution described effect.

Published 39 original articles · won praise 25 · views 120 000 +

Guess you like

Origin blog.csdn.net/u013536232/article/details/104124423