Skip to content

Instantly share code, notes, and snippets.

@n5i
Last active July 8, 2016 14:48
Show Gist options
  • Save n5i/9898d6035c2839938a6afa21d8e47675 to your computer and use it in GitHub Desktop.
Save n5i/9898d6035c2839938a6afa21d8e47675 to your computer and use it in GitHub Desktop.
Install golang 1.6 at CentOS 7
# Install golang 1.4 from epel repo which is used for installing golang 1.6 (sudo)
yum install golang
# Set up paths
sudo ln -s /usr/lib/golang/bin/linux_amd64/go /usr/lib/golang/bin
export GOROOT_BOOTSTRAP=/usr/lib/golang
# Download the golang sources
# In the current example the sorces are downloaded to the root folder of a user with the name "go"
git clone https://go.googlesource.com/go
cd go
git checkout go1.6.2
# Install go
cd src
./all.bash
# Remove old go(sudo)
yum remove golang
# Set up path to go binary(sudo)
ln -s /home/go/go/bin/go /usr/bin
# Set up env variables: add to .bashrc
# Where workspace is a work directory for projects
export GOROOT=$HOME/go
export PATH=$PATH:$GOROOT/bin
export GOPATH=$HOME/workspace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment