Skip to content

Instantly share code, notes, and snippets.

@joaorafaelm
Forked from jmervine/goinst.sh
Created October 24, 2015 22:33
Show Gist options
  • Save joaorafaelm/4083fc0374c357589c81 to your computer and use it in GitHub Desktop.
Save joaorafaelm/4083fc0374c357589c81 to your computer and use it in GitHub Desktop.
Installing GoLang - Ubuntu 12.04.3 LTS \n \l
#!/usr/bin/env bash
#
# Example usage:
#
# $ VERSION=1.3 sudo ./goinst.sh
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
test "$VERSION" || VERSION=1.3
set -ex
cd /tmp
wget http://golang.org/dl/go$VERSION.linux-amd64.tar.gz
tar -C /usr/local -xzf go$VERSION.linux-amd64.tar.gz
echo 'export PATH=/usr/local/go/bin:\$PATH' > /etc/profile.d/golang.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment