Skip to content

Instantly share code, notes, and snippets.

@jmervine
Last active July 31, 2016 02:36
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save jmervine/8321074 to your computer and use it in GitHub Desktop.
Save jmervine/8321074 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
@christianchristensen
Copy link

@diatmpravin
Copy link

There are many ways to configure the Go development environment on your computer, you can try this blog too - http://railskey.wordpress.com/2014/05/31/install-gogolang-on-ubuntu/

@nrshrivatsan
Copy link

@christianchristensen! Thank you.

@pdpi
Copy link

pdpi commented Aug 13, 2014

Great stuff, really useful. This line bit me in the arse though:

echo 'export PATH=/usr/local/go/bin:\$PATH' > /etc/profile.d/golang.sh

You want to use either single quotes, or escape the dollar, not both. As it stands, it wrote literally this:

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

to the profile, which means that the $PATH was obliterated.

@geosoft1
Copy link

geosoft1 commented Sep 1, 2014

i recently started a golang environment installer for Ubuntu
https://github.com/geosoft1/tools/
last version is here
https://github.com/geosoft1/tools/releases/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment