Installing and Configuring Golang 1.8 on Ubuntu 16.04

Installing and Configuring Golang 1.8 on Ubuntu 16.04

Last updated:
Table of Contents

Add this PPA

I see people sometime recommend ppa:longsleep/golang-backports instead, but it doesn't work for me 1

$ sudo add-apt-repository ppa:gophers/archive
$ sudo apt-get update

Install the runtime

$ sudo apt-get install golang-1.8

Setup the path and environment variables

  • add this to the end of ~/.profile:

    [[ -d "/usr/lib/go-1.8" ]] && export PATH="$PATH:/usr/lib/go-1.8/bin"
    
  • activate

    $ source  ~/.profile
    
  • test

    $ go version
    go version go1.8.1 linux/amd64
    

create workspace

Packages you install using go get get installed to this directory.

$ mkdir -p ~/go/bin
$ mkdir -p ~/go/src

1: Failed to fetch http://ppa.launchpad.net/longsleep/golang-backports/ubuntu/dists/trusty/main/binary-amd64/Packages


References