Install Go 1.11 on Ubuntu 18.04 & 16.04 LTS
Go 1.11 has hit the ground on 24 August 2018 and it has introduced few really needed tools and components including versioned modules, Experimental WebAssembly support, Debugging improvements and minor changes to core packages and performance/run-time.
This tutorial will help you to install Go 1.11 on your Ubuntu 18.04 LTS, 16.04 LTS, and 14.04 LTS systems.
Step 1 — Install Go Language
Upgrade to apply latest security updates on Ubuntu.
sudo apt-get update
sudo apt-get -y upgrade
Now you need to download the Go binary file. You can find the list of download links as per OS and architecture from their official package. To install it on Ubuntu 64-bit OS hit following commands
Now extract the downloaded archive and install it to the desired location on the system. I generally keep it under
/usr/local directory as suggested by standards.
sudo tar -xvf go1.11.linux-amd64.tar.gz
sudo mv go /usr/local
Step 2 — Setup Go Environment
Now let’s setup Go language environment variables
GOROOT is the location where Go package is installed on your system.
GOPATH is the location of your work directory. For example here directory is
Open your `.profile`file and add global variable as follow at the end of the file. You may want to add this into
.bashrc file as per your shell configuration.
Step 3 — Update current shell session
This will allow you to use go commands without restarting your terminal.
Step 4 — Verify Installation
You have successfully installed and configured go language on your system.
To check Go version.
// go version go1.11 linux/amd64
Now also verify all configured environment variables using the following command.
GOGCCFLAGS=”-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build476037005=/tmp/go-build -gno-record-gcc-switches”
You have successfully installed Go 1.11. You can now make some cool stuff with Go.
If you enjoyed this article, spare me some claps — it means the world to the writer and follow me if you want to read more articles about Go, JS, Technology and Startups.