This guide explains how to:
-
Check whether your current repository version of Go meets the required version
-
Remove older Go installations
-
Install the latest Go manually
-
Install Garble GitHub Repository
Check Available Go Version from Repository
Before installing manually, check whether your system repositories already provide a compatible Go version.
RHEL / AlmaLinux / RockyLinux / CentOS
dnf info golang
or on older systems:
yum info golang
Install from repository:
dnf install -y golang
Debian / Ubuntu
Update repositories:
apt update
Check available version:
apt policy golang-go
Install:
apt install -y golang-go
Verify Installed Go Version
go version
Example:
go version go1.25.9 linux/amd64
If the version is lower than the required version for Garble, proceed with the manual installation below.
Remove Older Go Installation
Remove existing Go binaries:
rm -rf /usr/local/go
Remove old PATH entries if necessary:
sed -i '/\/usr\/local\/go\/bin/d' ~/.bashrc
Install Latest Go Manually
Visit the official Go downloads page:
Example installation for Go 1.26.2:
cd /usr/local/src
wget https://go.dev/dl/go1.26.2.linux-amd64.tar.gz
Extract and remove the tar.gz file:
tar -C /usr/local -xzf go1.26.2.linux-amd64.tar.gz
rm -rf /usr/local/src/go*.linux-amd64.tar.gz
Configure PATH
System-wide configuration:
cat > /etc/profile.d/golang.sh << 'EOF'
export PATH=/usr/local/go/bin:$PATH
EOF
Set permissions:
chmod +x /etc/profile.d/golang.sh
Load environment:
source /etc/profile.d/golang.sh
Verify Go Installation
go version
Expected output:
go version go1.26.2 linux/amd64
Install Garble
Install latest Garble:
go install mvdan.cc/garble@latest
Add Go User Binary Path
Temporary:
export PATH=$PATH:$(go env GOPATH)/bin
Permanent:
echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.bashrc
source ~/.bashrc
Verify Garble Installation
garble -h
Build Obfuscated Go Binary
Basic stripped build:
garble build -ldflags="-s -w"
Recommended hardened build:
garble build -tiny -seed=random -ldflags="-s -w"
Options:
-
-tiny→ reduces runtime metadata -
-seed=random→ randomizes obfuscation every build -
-s -w→ strips symbols and debug information
Notes
Garble compatibility depends on the installed Go version.
Always verify the required Go version from:
go install mvdan.cc/garble@latest
If the installed version is unsupported, Go will display the minimum required version automatically.
