Install Go 1.5 On CentOS 6 and 7

Oh Dear! monitors your entire site, not just the homepage. We crawl and search for broken pages and mixed content, send alerts when your site is down and notify you on expiring SSL certificates.

Start your free 10 day trial! »

Image of Mattias Geniar

Mattias Geniar, August 23, 2015

Follow me on Twitter as @mattiasgeniar

This is a really quick guide on how to install the recently released Go 1.5 on a CentOS 6 or 7 server.

Start by grabbing the latest 1.5 release from the download pages.

$ cd /tmp
$ wget https://storage.googleapis.com/golang/go1.5.linux-amd64.tar.gz

Extract the binary files to /usr/local/go.

$ tar -C /usr/local -xzf /tmp/go1.5.linux-amd64.tar.gz

For easy access, symlink your installed binaries in /usr/local/go to /use/local/bin, which should be in your default $PATH in your shell.

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

$ ln -s /usr/local/go/bin/go /usr/local/bin/go
$ ln -s /usr/local/go/bin/godoc /usr/local/bin/godoc
$ ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt

Alternatively, add the /usr/local/go/bin directory to your $PATH. Add the following line to your ~/.profile file.

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

You now have the working go binary for version 1.5

$ go version
go version go1.5 linux/amd64


Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.