Install Go on Ubuntu LTS

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

Sha256: 9e9b755d63b36acf30c12a9a3fc379243714c1c6d3dd72861da637f336ebb35b

sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xvf go1.25.5.linux-amd64.tar.gz && rm -rf go1.25.5.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 *