All thoughts and posts are my own, said by @rakibtg.
posted at Sunday, 18 March 2018
Installing the latest version of Go in Linux

I found it difficult while managing a programming language like Go with PPA, because PPA's are not always up to date with official stable releases and also it is difficult to purge the language with PPA and reinstalling or updating version is also painful.

Wah, thats a lot of issue in a single paragraph!

In this article, we will learn about how to install the latest version of Go Programming Language without using any PPA.


The Go Getting Started documentation provides all the details, for cross platform installation. In this article we will only talk about installing Go in Linux distributions, I will be using Ubuntu 16.04 but this should work across varieties of other Linux distributions like Mint OS, Elementary OS etc.

Download Go

To download the latest version of Go language, go to the official download page and choose the latest version of Go binary for Linux.

Move Go Binaries

First, extract the archived file you just downloaded. To extract, open the terminal where you have  downloaded the Go archive. Then extract using this command,

tar xvzf go1.10.linux-amd64.tar.gz

The Go archive file name could be different upon time.
Now you would have a "go" directory, that you have to move into the "/usr/local/".

Go to the terminal and run,

sudo mv ./go/ /usr/local/

This would move the go directory into the /usr/local/

Introduce Go To Your System

We are almost there, we will now add the go command system-wide. To do that type this in your terminal,

sudo nano /etc/profile

Now scroll to the end of the profile file and add this line at the end,

export PATH=$PATH:/usr/local/go/bin

Now, in order to get go command work in terminal we need to reload the source cache.
To do that in a terminal run this,

source /etc/profile

Go should now work in your system, to test run go in a terminal window, if everything works then the output should be similar to below screenshot.

Go programming language running in ubuntu terminal