Install Go on Ubuntu LTS

cd /tmp
curl -OL https://golang.org/dl/go1.25.6.linux-amd64.tar.gz

echo "f022b6aad78e362bcba9b0b94d09ad58c5a70c6ba3b7582905fababf5fe0181a  go1.25.6.linux-amd64.tar.gz" | shasum -a 256 -c


Bash

Sha256: f022b6aad78e362bcba9b0b94d09ad58c5a70c6ba3b7582905fababf5fe0181a

sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xvf go1.25.6.linux-amd64.tar.gz && rm -rf go1.25.6.linux-amd64.tar.gz
Bash
nano ~/.profile
Bash

Then, add the following information to the end of this file:

export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
Bash

And then reload the profile

source ~/.profile
Bash

Add go to global path

sudo nano /etc/profile
Bash
export PATH=$PATH:/usr/local/go/bin
Bash

If you want to clear Go cache

go clean -cache
Bash

If you want to force reinstall all globally installed binaries

Make sure you have go-global-update installed

go install github.com/Gelio/go-global-update@latest
Bash
# dry run
go-global-update -n
Bash
# force upgrade all
go-global-update -f
Bash

To Install on RPi

curl -OL https://golang.org/dl/go1.25.1.linux-arm64.tar.gz
sha256sum go1.25.1.linux-arm64.tar.gz
Bash

Sha256: 65a3e34fb2126f55b34e1edfc709121660e1be2dee6bdf405fc399a63a95a87d

sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xvf go1.25.1.linux-arm64.tar.gz
Bash

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *