Skip to content

Instantly share code, notes, and snippets.

@RavenZZ
Created November 14, 2016 14:44
Show Gist options
  • Select an option

  • Save RavenZZ/e3469d5cefc07e09047ffb658209bea2 to your computer and use it in GitHub Desktop.

Select an option

Save RavenZZ/e3469d5cefc07e09047ffb658209bea2 to your computer and use it in GitHub Desktop.
install golang on ubuntu

How to Install Go 1.6 on Ubuntu 16.04

link

Prerequisites

This tutorial assumes that you have access to an Ubuntu 16.04 system, configured with a non-root user with sudo privileges as described in Initial Server Setup with Ubuntu 16.04.

Step 1 — Installing Go

    ssh sammy@your_server_ip
    
    cd ~
    curl -O https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz
    
    
    tar xvf go1.6.linux-amd64.tar.gz
    
    #You should now have a directory called go in your home directory. Recursively change go's owner and group to root, and move it to /usr/local:
    sudo chown -R root:root ./go
    sudo mv go /usr/local

Step 2 — Setting Go Paths

    sudo vim /etc/profile
    export GOPATH=/media/raven/Data/gowork
    export GOROOT=/usr/local/go
    export PATH=$PATH:$GOPATH/bin:$GOROOT/bin


    source /etc/profile

Step 3 — Testing Your Install

    mkdir $HOME/work
    nano ~/work/src/github.com/user/hello/hello.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment