Skip to content

Instantly share code, notes, and snippets.

@glowinthedark
Forked from pcgeek86/install_go_pi.sh
Last active June 25, 2023 13:58
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 glowinthedark/9725645a67ab4d02a5aa3bcfc637cddd to your computer and use it in GitHub Desktop.
Save glowinthedark/9725645a67ab4d02a5aa3bcfc637cddd to your computer and use it in GitHub Desktop.
Install Go Lang on Raspberry Pi
cd /tmp
fileName='go1.20.5.linux-armv6l.tar.gz'
wget -c https://go.dev/dl/$fileName && sudo rm -rfv /usr/local/go && sudo tar -C /usr/local -xvf $fileName
grep -q 'GOPATH=' ~/.bashrc || cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
EOF
source ~/.bashrc
read -p "Press any key to delete downloaded file: $fileName..."
rm -rf "$fileName"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment