Skip to content

Instantly share code, notes, and snippets.

@suenot
Last active February 28, 2024 20:58
Show Gist options
  • Save suenot/46ae31f7a1fec70182241ae25420285a to your computer and use it in GitHub Desktop.
Save suenot/46ae31f7a1fec70182241ae25420285a to your computer and use it in GitHub Desktop.
Install Go
sudo apt-get -y install golang-go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> ~/.bashrc
@Konard
Copy link

Konard commented Feb 4, 2024

On my server, I was not able to download go from the original source.

wget https://fossies.org/linux/misc/go1.21.6.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.21.6.linux-amd64.tar.gz

And to install dependencies, I had to use china proxy:

GOPROXY=https://goproxy.cn make install
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

echo 'export GOROOT=/usr/local/go' >> ~/.bashrc
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> ~/.bashrc

@suenot
Copy link
Author

suenot commented Feb 16, 2024

wget https://fossies.org/linux/misc/go1.22.0.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz

@suenot
Copy link
Author

suenot commented Feb 28, 2024

wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz

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