HOWTO : Install Go Language 1.8 on Ubuntu 16.04 LTS

The current Go version is 1.6 on Ubuntu 16.04. However, the official Go version is 1.8 as of this writing. We need to install Gophers Ubuntu PPA to complete the task.



Step 1 :



sudo add-apt-repository ppa:gophers/archive

sudo apt update

sudo apt install golang-1.8




Step 2 :



The workspace is "go" at your working directory by default (such as /home/samiux/go).



nano ~/.profile



Append the following lines at the end of the file :



export PATH=$PATH:/usr/lib/go-1.8/bin:$HOME/go/bin



Step 3 :



Log out and re-login.



or



source ~/.profile



Step 4 :



To test if it is working properly :



go version

go env




Step 5 :



Make sure you create the following directories at the "go" workspace :



mkdir -p {,~/go/bin,~/go/pkg,~/go/src}



You build your project, for example "erp", at "~/go/src/erp".



That's all! See you.