Go - Download and Install the Go CLI on Linux
by
Jeremy Canfield |
Updated: August 04 2024
| Go articles
Download the go TAR archive from https://go.dev/dl/ and upload the TAR archive onto your Linux system.
Create a directory for the go CLI.
mkdir /usr/local/bin/go1.22.5
The tar command can be used to extract the go TAR archive.
tar -zxpf /path/to/go1.22.5.linux-amd64.tar.gz --directory /usr/local/bin/go1.22.5/
You can now use the full path to the go CLI to verify the go CLI is working as expected.
/usr/local/bin/go1.22.5/go/bin/go version
Assuming the go CLI is working as expected, you can remove the TAR archive.
rm go1.22.5.linux-amd64.tar.gz
Almost always, you can going to want to create a symbolic link from /usr/bin/go to the full path to the go CLI so that you can just issue the go command on the command line.
ln -s /usr/local/bin/go1.22.5/go/bin/go /usr/bin/go
And now just the "go" command can be used.
~]$ go version
go version go1.22.5 linux/amd64
Did you find this article helpful?
If so, consider buying me a coffee over at