Skip to content

Instantly share code, notes, and snippets.

@thangchung
Forked from nikhita/update-golang.md
Created February 2, 2023 09:13
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 thangchung/2781962b523ebc8d307c6b919f2d3e11 to your computer and use it in GitHub Desktop.
Save thangchung/2781962b523ebc8d307c6b919f2d3e11 to your computer and use it in GitHub Desktop.
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

$ sudo rm -rf /usr/local/go

2. Install the new version

Go to the downloads page and download the binary release suitable for your system.

3. Extract the archive file

To extract the archive file:

$ sudo tar -C /usr/local -xzf /home/nikhita/Downloads/go1.8.1.linux-amd64.tar.gz

4. Make sure that your PATH contains /usr/local/go/bin

$ echo $PATH | grep "/usr/local/go/bin"
@thangchung
Copy link
Author

@thangchung
Copy link
Author

If you have Go installed already, an easy way to try go1.18
is by using the go command:
$ go install golang.org/dl/go1.18@latest
$ go1.18 download If you have Go installed already, an easy way to try go1.18
is by using the go command:
$ go install golang.org/dl/go1.18@latest
$ go1.18 download

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