Linux Go Installation Steps

Linux, macOS, and FreeBSD tarballs

Go to the Go language download page web site and choose the Linux platform. The example below show the download page link and the Go language version as of this posting to be downloaded.

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

Extract it into /usr/local, creating a Go tree in /usr/local/go. For example:

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

(Typically these commands must be run as root or through sudo.)

Add /usr/local/go/bin to the PATH environment variable. You can do this by adding this line to your /etc/profile (for a system-wide installation) or $HOME/.profile:

export PATH=$PATH:/usr/local/go/bin

Note: changes made to a profile file may not apply until the next time you log into your computer. To apply the changes immediately, just run the shell commands directly or execute them from the profile using a command such as source $HOME/.profile.