Last active
January 15, 2025 01:37
-
-
Save albertocavalcante/19ddd5555229eab3f0e130a5ec5dacec to your computer and use it in GitHub Desktop.
Install GoLang in WSL2
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
sudo rm -rf /usr/local/go* && sudo rm -rf /usr/local/go |
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
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 |
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
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 |
@albertocavalcante not available anymore
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
Source: How to Install Golang on WSL/WSL2