Skip to content

Instantly share code, notes, and snippets.

@thesubtlety
Created January 5, 2023 20:15
Show Gist options
  • Save thesubtlety/7a6b630f0881643b0e752bb52f050ecb to your computer and use it in GitHub Desktop.
Save thesubtlety/7a6b630f0881643b0e752bb52f050ecb to your computer and use it in GitHub Desktop.
Install go to home dir on debian
#!/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