Created
August 5, 2021 05:16
-
-
Save tobychui/80afe6e866fea8db2b7edf9a422b78b9 to your computer and use it in GitHub Desktop.
Go installer script for Linux ARM SBC
This file contains hidden or 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
#/bin/bash | |
echo "Input the go arch to install (arm/arm64/amd64)" | |
read -p "Architecture: " arch | |
if [ "$arch" = "arm" ]; then | |
echo "Installing arm version of go" | |
wget https://golang.org/dl/go1.15.3.linux-armv6l.tar.gz | |
fi | |
if [ "$arch" = "arm64" ]; then | |
echo "Installing arm64 version of go" | |
wget https://golang.org/dl/go1.15.3.linux-arm64.tar.gz | |
fi | |
if [ "$arch" = "amd64" ]; then | |
echo "Installing amd64 version of go" | |
wget https://golang.org/dl/go1.15.3.linux-amd64.tar.gz | |
fi | |
sudo tar -C /usr/local -xzf go* | |
#echo "ADD THE FOLLOWING LINE TO YOUR ~/.bashrc FILE:" | |
#echo 'export PATH=$PATH:/usr/local/go/bin' | |
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc | |
source .bashrc | |
echo "Install Complted" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following Bash script is an updated version I made that will work for future use cases even when the latest stable version of GO is updated: