Skip to content

Instantly share code, notes, and snippets.

@gwillem
Created November 24, 2022 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwillem/f2ce184456d431291fccca682a183711 to your computer and use it in GitHub Desktop.
Save gwillem/f2ce184456d431291fccca682a183711 to your computer and use it in GitHub Desktop.
Install latest go version on Ubuntu/Debian
#!/bin/bash
set -e
ver=$(curl -Ls https://golang.org/VERSION?m=text)
dst=/opt/go-$ver
sudo mkdir -p $dst
curl -Ls "https://dl.google.com/go/$ver.linux-$(dpkg --print-architecture).tar.gz" -o - | sudo tar -xz --strip-components=1 -C $dst
sudo rm -f /opt/go
sudo ln -sf go-$ver /opt/go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment