Skip to content

Instantly share code, notes, and snippets.

@danclegg
Last active September 26, 2017 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danclegg/b3c03ae3d0ef63634dfda46d6d5218a8 to your computer and use it in GitHub Desktop.
Save danclegg/b3c03ae3d0ef63634dfda46d6d5218a8 to your computer and use it in GitHub Desktop.
Install golang on raspberry pi
#!/bin/bash
# derivative work
# credit: chrisvdg (https://codegists.com/snippet/shell/install-golang-armv6sh_chrisvdg_shell)
echo "Dowloading Go"
wget --no-check-certificate https://storage.googleapis.com/golang/go1.9.linux-armv6l.tar.gz
echo "extracting Go"
sudo tar -C /usr/local -xzf go1.9.linux-armv6l.tar.gz
# cleanup
echo "extracting Go download file"
rm go1.9.linux-armv6l.tar.gz
echo "Setting up Go evironment"
mkdir ~/go ~/go/src ~/go/bin ~/go/pkg
echo "Setting up Go evironmental variables"
echo "" >> ~/.profile
echo "# golang" >> ~/.profile
echo "export GOPATH=~/go" >> ~/.profile
## Don't think GOSRC is needed
#echo "export GOSRC=~/go/src" >> ~/.profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.profile
# source the new exports
source ~/.profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment