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
command is required.
- # - requires given linux commands to be executed with root privileges either directly as a root user or by use of
- $ - 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
page and either download your relevant Golang Linux libraries directly using your browser or simply use
command as shown below:
$ wget -q https://storage.googleapis.com/golang/go1.7.4.linux-amd64.tar.gz
Once downloaded, you should be able to see the
$ 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
$ sudo tar -C /usr/local/bin -xzf go1.7.4.linux-amd64.tar.gz
Check the content of
$ 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
# golang local root installation directory
# golang binary-release PATH.
# golang binaries location
# golang compiled binaries PATH.
Now we need to
the above edited
file which makes all new Go environment variables available. To do so, either re-login from your current shell session or execute:
$ . .bashrc
Testing Go Language Installation
All should now be ready. First, check
$ go version
go version go1.7.4 linux/amd64
Execute a sample hello world example:
$ sudo apt-get install git
$ go get github.com/golang/example/hello
Hello, Go examples!