Go is an open source programming language developed by Google. The objective is to install latest Go language pre-compiled binaries on Ubuntu 16.04 Linux.
Privileged access to your Ubuntu System as root or via sudo command is required.
# - requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ - requires given linux commands to be executed as a regular non-privileged user
Download Go language binaries
First, we need to download Go language binaries. Visit https://golang.org/dl/ page and either download your relevant Golang Linux libraries directly using your browser or simply use wget command as shown below:
Once downloaded, you should be able to see the Go tarball with ls command:
$ ls go*
Install Go binaries
The installation of Go binaries simply involves a previously downloaded tarball decompression into a desired directory. The below command will extract the content of go1.7.4.linux-amd64.tar.gz tarball into /usr/local/bin/go directory.
$ sudo tar -C /usr/local/bin -xzf go1.7.4.linux-amd64.tar.gz
Check the content of /usr/local/bin directory:
$ ls /usr/local/bin/
Setup Go Environment
All Go binaries are now ready, what remains, is Go environment setup. To do so, open your favorite text editor and append the following lines into your ~/.bashrc file: