Blog > detail

Just my tiny mind

Install Go Programming Language in Ubuntu

26-2-2012 Admin General 2 Comments

I know that Go Lang is not a new programming language. However, The reason I write down this is for me to easily remember the How To that I find in the internet. And to make me easier to do it again in the future.

  • Run apt-get to install Go Lang

sudo apt-get install golang

  • Set Go path:

mkdir -p ~/go;

echo "export GOPATH=$HOME/go" >> ~/.bashrc;

echo "export PATH=$PATH:$HOME/go/bin:/usr/local/go/bin" >> ~/.bashrc;

  • Create directory src/ inside your $home/go directory.

exp: /home/user/go/src/

  • Create a file hello.go inside /home/user/go/src/
  • Edit the file and put your code


package main

import "fmt"

func main() {

    fmt.Println("hello world")


  • Compile

$ go install

  • Run

$ $GOPATH/bin/hello

I hope this tips can help anyone who want to install Go programming Language in Ubuntu.