Skip to content

Instantly share code, notes, and snippets.

@FrancisTurner
Last active December 13, 2021 06:28
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 FrancisTurner/f1cd3d60f5a7e7f5ffd07dc0aed03ba8 to your computer and use it in GitHub Desktop.
Save FrancisTurner/f1cd3d60f5a7e7f5ffd07dc0aed03ba8 to your computer and use it in GitHub Desktop.
One liner to retrieve the latest released go version for raspberry pis
curl -L https://golang.org/dl/$(curl -s https://api.github.com/repos/golang/go/git/matching-refs/tags/go | grep '/ref' | sed -e '/beta/ d' -e '/rc/ d' -e 's/.*\(go[0-9.]*\).*/\1/' | tail -1).linux-armv6l.tar.gz | sudo tar -xzC /usr/local
# change armv6l for arm64 to get the 64 bit version for pi 4s
#set up etc.
echo 'PATH=$PATH:/usr/local/go/bin' >> ~/.profile
source ~/.profile
which go
go version
#optionally
# echo 'GOPATH=/home/pi/golang' >> ~/.profile
# mkdir /home/pi/golang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment