Skip to content

Instantly share code, notes, and snippets.

@zoonderkins
Last active March 6, 2026 22:36
Show Gist options
  • Select an option

  • Save zoonderkins/8c0c7eba6d7b12d5da6a8bdeec1da9b2 to your computer and use it in GitHub Desktop.

Select an option

Save zoonderkins/8c0c7eba6d7b12d5da6a8bdeec1da9b2 to your computer and use it in GitHub Desktop.
Install Golang on Debian / Raspberry Pi #linux

Last update at 2026-03-06

Install Golang on Debian / Raspberry Pi

rm -rf /usr/local/go
GOVERSION="1.26.1"
wget "https://golang.org/dl/go${GOVERSION}.linux-amd64.tar.gz" -4
tar -C /usr/local -xvf "go${GOVERSION}.linux-amd64.tar.gz"
rm "go${GOVERSION}.linux-amd64.tar.gz"

For Bash

cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
EOF

source ~/.bashrc

For ZSH

cat >> ~/.zshrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
EOF

source ~/.zshrc
@venkatrahul-software-development
Copy link

venkatrahul-software-development commented Mar 6, 2026

For Raspberry pi 5 (Raspberry pi OS Trixie), the above mentioned installation code needs to be updated:

replace amd64 with arm64

Please see the updated code that works:

rm -rf /usr/local/go # comment this line if this is a fresh install of Go
GOVERSION="1.26.1"
wget "https://golang.org/dl/go${GOVERSION}.linux-arm64.tar.gz" -4
tar -C /usr/local -xvf "go${GOVERSION}.linux-arm64.tar.gz"
rm "go${GOVERSION}.linux-arm64.tar.gz

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment