Created
January 5, 2023 20:15
-
-
Save thesubtlety/7a6b630f0881643b0e752bb52f050ecb to your computer and use it in GitHub Desktop.
Install go to home dir on debian
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 | |
# Install golang to home dir | |
GOPATH="$HOME/go" | |
GOUTIL="$HOME/.go" | |
LATEST="$(curl -s https://go.dev/VERSION?m=text)" | |
DL_PKG="$LATEST.linux-amd64.tar.gz" | |
DL_URL="https://go.dev/dl/$DL_PKG" | |
wget "$DL_URL" -P "$GOUTIL" | |
rm -rf "$GOPATH" && tar -C $HOME -xzf "$GOUTIL/$DL_PKG" | |
export PATH=$PATH:$HOME/go/bin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment