Tuesday, 1 January 2019

How to install Go on Ubuntu 18.04

Download archive for Ubuntu from golang's Download page and unpack it into /usr/local:

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



This creates /usr/local/go installation directory which contains binaries in /usr/local/go/bin. This path, together with the path to your Go workspace directory (unless it's placed at its default location $HOME/go) shall be added to bash configuration so it's accessible from terminal. Open the configuration:

$ sudo gedit ~/.bashrc

and add:

export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/dev/go

To test the installation, please find the procedure in How to install Go on Nvidia Jetson TX2 article.