Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save albertocavalcante/19ddd5555229eab3f0e130a5ec5dacec to your computer and use it in GitHub Desktop.
Save albertocavalcante/19ddd5555229eab3f0e130a5ec5dacec to your computer and use it in GitHub Desktop.
Install GoLang in WSL2
sudo rm -rf /usr/local/go* && sudo rm -rf /usr/local/go
VERSION=1.21.3
OS=linux
ARCH=amd64
cd $HOME
wget https://go.dev/dl/go$VERSION.$OS-$ARCH.tar.gz
tar -xvf go$VERSION.$OS-$ARCH.tar.gz
mv go go-$VERSION
sudo mv go-$VERSION /usr/local
export GOROOT=/usr/local/go-1.21.3
export GOPATH=$HOME/projects/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
export PATH=$PATH:$HOME/projects/go/bin
@HappyLuckYesterday
Copy link

wget https://go.dev/dl/go1.23.4.linux-amd64.tar.gz
tar -xvf go1.23.4.linux-amd64.tar.gz
sudo mv go /usr/local
export GOROOT=/usr/local/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
go version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment