How to install go 1.8 on Ubuntu 16.04

If install golang in Ubuntu 16.04 throught synaptic, you will install version 1.6 and maybe you will see the following problems:

cannot find package "" in any of:
/usr/lib/go-1.6/src/ (from $GOROOT)
/src/ (from $GOPATH)
exit status 1
exit status 1

To avoid it, is better install it from the source:

sudo tar -zxvf go1.8.linux-amd64.tar.gz -C /usr/local/
mkdir ~/go
echo 'export GOROOT=/usr/local/go' >> ~/.bashrc
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> ~/.bashrc
source ~/.bashrc

Enjoy it!


Popular posts from this blog

Fix "Set scan parameters failed: Input/output error" on Ubuntu 16.04

from: can't read /var/mail/ in Python scripts

SNMP + Telegraf + InfluxDB