Advanced Go Installation Guide
This guide provides installation instructions for Go on additional operating systems and distributions that are less commonly used. GSwarm requires Go 1.24+ to build and run.
🔧 Advanced Go Installation Instructions
Linux Distributions
CentOS/RHEL
Option 1: Using yum
# Install Go
sudo yum install golang
# Verify installation
go version
Option 2: Manual Installation
# Download Go for Linux
wget https://go.dev/dl/go1.24.0.linux-amd64.tar.gz
# Extract to /usr/local
sudo tar -C /usr/local -xzf go1.24.0.linux-amd64.tar.gz
# Add to PATH (add to ~/.bashrc)
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
# Verify installation
go version
Fedora
Option 1: Using dnf
# Install Go
sudo dnf install golang
# Verify installation
go version
Option 2: Manual Installation
# Download Go for Linux
wget https://go.dev/dl/go1.24.0.linux-amd64.tar.gz
# Extract to /usr/local
sudo tar -C /usr/local -xzf go1.24.0.linux-amd64.tar.gz
# Add to PATH (add to ~/.bashrc)
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
# Verify installation
go version
Arch Linux
Option 1: Using pacman
# Install Go
sudo pacman -S go
# Verify installation
go version
Option 2: Manual Installation
# Download Go for Linux
wget https://go.dev/dl/go1.24.0.linux-amd64.tar.gz
# Extract to /usr/local
sudo tar -C /usr/local -xzf go1.24.0.linux-amd64.tar.gz
# Add to PATH (add to ~/.bashrc)
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
# Verify installation
go version
Alpine Linux
Option 1: Using apk
# Install Go
apk add go
# Verify installation
go version
Option 2: Manual Installation
# Download Go for Linux
wget https://go.dev/dl/go1.24.0.linux-amd64.tar.gz
# Extract to /usr/local
tar -C /usr/local -xzf go1.24.0.linux-amd64.tar.gz
# Add to PATH (add to ~/.profile)
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile
source ~/.profile
# Verify installation
go version
BSD Systems
FreeBSD
Option 1: Using pkg
# Install Go
pkg install go
# Verify installation
go version
Option 2: Manual Installation
# Download Go for FreeBSD
fetch https://go.dev/dl/go1.24.0.freebsd-amd64.tar.gz
# Extract to /usr/local
sudo tar -C /usr/local -xzf go1.24.0.freebsd-amd64.tar.gz
# Add to PATH (add to ~/.cshrc or ~/.profile)
echo 'setenv PATH $PATH:/usr/local/go/bin' >> ~/.cshrc
source ~/.cshrc
# Verify installation
go version
OpenBSD
Option 1: Using pkg_add
# Install Go
pkg_add go
# Verify installation
go version
Option 2: Manual Installation
# Download Go for OpenBSD
ftp https://go.dev/dl/go1.24.0.openbsd-amd64.tar.gz
# Extract to /usr/local
sudo tar -C /usr/local -xzf go1.24.0.openbsd-amd64.tar.gz
# Add to PATH (add to ~/.profile)
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile
source ~/.profile
# Verify installation
go version
ARM-based Systems
Raspberry Pi (ARM64)
Option 1: Using apt (Raspberry Pi OS)
# Update package list
sudo apt update
# Install Go
sudo apt install golang-go
# Verify installation
go version
Option 2: Manual Installation (ARM64)
# Download Go for Linux ARM64
wget https://go.dev/dl/go1.24.0.linux-arm64.tar.gz
# Extract to /usr/local
sudo tar -C /usr/local -xzf go1.24.0.linux-arm64.tar.gz
# Add to PATH (add to ~/.bashrc)
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
# Verify installation
go version
ARM32 (Raspberry Pi 3 and earlier)
Manual Installation (ARM32)
# Download Go for Linux ARM
wget https://go.dev/dl/go1.24.0.linux-armv6l.tar.gz
# Extract to /usr/local
sudo tar -C /usr/local -xzf go1.24.0.linux-armv6l.tar.gz
# Add to PATH (add to ~/.bashrc)
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
# Verify installation
go version
Container Environments
Docker
Using Official Go Image
# Use official Go image
FROM golang:1.24-alpine
# Set working directory
WORKDIR /app
# Copy go mod files
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Copy source code
COPY . .
# Build the application
RUN go build -o main .
# Run the application
CMD ["./main"]
Multi-stage Build Example
# Build stage
FROM golang:1.24-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -o main .
# Runtime stage
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /app/main .
CMD ["./main"]
Cloud Platforms
Google Cloud Platform (GCP)
Using Cloud Shell
# Go is pre-installed in Cloud Shell
go version
# If not available, install manually
wget https://go.dev/dl/go1.24.0.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.24.0.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
AWS EC2
Amazon Linux 2
# Install Go
sudo yum install golang
# Verify installation
go version
Ubuntu on EC2
# Update package list
sudo apt update
# Install Go
sudo apt install golang-go
# Verify installation
go version
Setting Up Go Environment
After installing Go on any of these systems, set up your environment:
# Set GOPATH (optional, Go 1.11+ uses modules by default)
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
# Add to your shell profile
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
echo 'export PATH=$PATH:$GOPATH/bin' >> ~/.bashrc
source ~/.bashrc
# Verify Go environment
go env GOPATH
go env GOROOT
Verifying Installation
After installation, verify everything is working:
# Check Go version (should be 1.24+)
go version
# Check Go environment
go env
# Test Go installation
mkdir test-go && cd test-go
go mod init test
echo 'package main
import "fmt"
func main() {
fmt.Println("Hello, Go!")
}' > main.go
go run main.go
# Should output: Hello, Go!
🐛 Troubleshooting
Common Issues
"go: command not found"
- Ensure Go is installed and in your PATH
- Check your shell profile file (~/.bashrc, ~/.zshrc, ~/.profile, etc.)
- Restart your terminal after installation
"Permission denied"
- Use
sudo
for system-wide installation - Or install to your home directory and add to PATH
Architecture-specific issues
- Ensure you're downloading the correct architecture version
- Check your system architecture:
uname -m
- For ARM systems, use the appropriate ARM version
Version too old
- GSwarm requires Go 1.24+
- Update Go using your package manager or download the latest version
Getting Help
If you encounter issues with Go installation:
- Check Go Documentation: https://go.dev/doc/install (opens in a new tab)
- Verify Installation: Run
go version
andgo env
- Check PATH: Ensure Go binaries are in your system PATH
- Restart Terminal: Close and reopen your terminal after installation
- Check Architecture: Ensure you're using the correct binary for your system
📚 Additional Resources
- Official Go Installation Guide (opens in a new tab)
- Go Environment Variables (opens in a new tab)
- Go Modules (opens in a new tab)
- Go Workspaces (opens in a new tab)
- Go Download Page (opens in a new tab)
🔗 Next Steps
After installing Go, you can proceed with installing GSwarm.
For standard operating systems, see the main Go installation guide.