Last active
December 13, 2021 06:28
-
-
Save FrancisTurner/f1cd3d60f5a7e7f5ffd07dc0aed03ba8 to your computer and use it in GitHub Desktop.
One liner to retrieve the latest released go version for raspberry pis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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