Skip to content

Instantly share code, notes, and snippets.

@0Ams
Created July 12, 2021 14:56
Show Gist options
  • Save 0Ams/c4dbbc054e224b9a50cc533f85339db2 to your computer and use it in GitHub Desktop.
Save 0Ams/c4dbbc054e224b9a50cc533f85339db2 to your computer and use it in GitHub Desktop.
update-golang.md

How to update the Go version

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

prepare

Changed root account

$ sudo su

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:

$ 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:

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

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

$ echo $PATH | grep "/usr/local/go/bin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment