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 "golang.org/x/sync/errgroup" in any of:
/usr/lib/go-1.6/src/golang.org/x/sync/errgroup (from $GOROOT)
/src/golang.org/x/sync/errgroup (from $GOPATH)
exit status 1
exit status 1

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

wget https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz
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!

Comments

Popular posts from this blog

Exception: Could not find a default OpenFlow controller in Mininet

How to fix Android when developer options are not available for this user

Webcam streaming throught VLC with YUY2 compatibility