Install Latest Version of Go (Linux/OSX) (original) (raw)
Written byEdd Turtle on gophercoding.com
on 4th of June 2022
(Updated: 25th of December 2023)
This article describes how to install the latest version of Go (golang). It also helpfully updates itself by pulling the latest version numbers directly, so you don’t have to go and dig out the latest version each time they release a version (yay!) - just copy and paste away. For more info, try their installer docs.
Ubuntu/Linux
Step 1) Download
| 1 | wget https://dl.google.com/go/GOVERSION.linux-amd64.tar.gz |
|---|
Step 2) Extract & Install
| 1 | sudo tar -C /usr/local -xvf GOVERSION.linux-amd64.tar.gz |
|---|
Step 3) Add Path to file (if you are installing for the first time)
| 1 | echo "export PATH=\$PATH:/usr/local/go/bin" >> $HOME/.profile |
|---|
Step 4) Test
If you’re trying to update your go version instead of installing it, you can clear your existing version by calling: sudo rm -rvf /usr/local/go/.
OSX
Download the latest installer at:
| 1 | https://go.dev/dl/GOVERSION.darwin-amd64.pkg |
|---|
Easy! (hopefully) Let us know in comments below if you hit any issues.

Edd is a PHP and Go developer who enjoys blogging about his experiences, mostly about creating and coding new things he's working on and is a big beliver in open-source and Linux.