Install Go v1.15.2

1. Apply the latest security updates on Ubuntu

sudo apt-get update
sudo apt-get -y upgrade

2. Download the latest Go language library archive

wget https://dl.google.com/go/go1.15.2.linux-amd64.tar.gz

3. Extract the downloaded archive and install it to desired location on your system. We suggest that you install go under /usr/local

sudo tar -xvf go1.15.2.linux-amd64.tar.gz 
sudo tar -C /usr/local
sudo ln  -s /usr/local/go/bin/go /usr/bin/

4. Set up 3 language environment variables for your project: GOROOT, GOPATH, and PATH

export GOROOT=/usr/local/go
export GOPATH=$HOME/Projects/Proj1
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

5. Done! Verify the installed version of Go and all environment variables

go version
go env

Last updated