install the latest golang on ubuntu Mar
04
1
7

 You can install golang in ubuntu through apt-get, but it tends to be out of date by a few versions. Luckily, it's easy to install the latest version on any system.

Head to the golang download page: https://golang.org/dl/ and grab the download link. Then back on the server run the following:

wget https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz
tar -xvzf go1.8.linux-amd64.tar.gz
sudo mv go /usr/local/go

Next, you just need to set up your envars:

export GOROOT=/usr/local/go
export GOPATH=~/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

# check that it installed correctly
go version
go env

That's it!

Bookmark and Share
blog comments powered by Disqus