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