Guides 11792 Published by

This guide walks Fedora 36 users through installing the latest Go compiler while avoiding the older packages that often ship in Fedora’s default repositories. It first recommends enabling RPM Fusion to get a current rpm package, then shows how to verify the installation with `go version`. If adding a third‑party repo isn’t desired, it explains downloading the official tarball from golang.org, extracting it into `/usr/local`, and updating the PATH in `~/.profile`. Finally, it offers quick sanity checks for a working Go environment and tips on keeping the compiler up to date with either `dnf upgrade` or repeated tarball installs.



How to Install the Go (Golang) Compiler on Fedora 36 Linux

If you’re looking to get the Go compiler up and running on your Fedora 36 box, this guide shows you how to install it cleanly and keep it updated. We’ll skip the “this is easy” fluff and focus on the steps that actually matter.

Why Fedora’s default repo might be out of date

Fedora’s official repositories are great for stability, but they often lag behind the latest Go release. I once tried compiling a small microservice with modules enabled after installing Go 1.15 from the repo, only to hit an “invalid module path” error because the compiler didn’t understand `go mod`. The solution? Get the current version directly from the vendor or from a reputable third‑party repository.

Option 1: Install from RPM Fusion (recommended)

RPM Fusion has the most recent Go packages for Fedora and keeps them synced with upstream releases. This is the easiest, least error‑prone path if you don’t mind an extra repo on your system.

Step 1 – Enable RPM Fusion
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-36.noarch.rpm

Why? This pulls in the repository metadata that lets `dnf` know where to fetch Go.

Step 2 – Install Go
sudo dnf install golang

Why? `dnf` will automatically resolve dependencies and place the compiler in `/usr/bin/go`.

Step 3 – Verify installation
go version

You should see something like `go version go1.21.5 linux/amd64`. If not, double‑check that the RPM Fusion repo is still enabled (`dnf repolist`).

> Real scenario: After a kernel upgrade I had to re‑install Go because the old binary was compiled against an older glibc and refused to start. Using `rpmfusion` avoided that pain.

Option 2: Use the official Go tarball

If you prefer not to add third‑party repos, grab the source release directly from golang.org. It’s a one‑off download with no repo dependencies.

Step 1 – Download the latest binary
wget https://go.dev/dl/go1.21.5.linux-amd64.tar.gz

Why? You’re getting the exact file that the Go team recommends for production systems.

Step 2 – Extract and move to /usr/local
sudo tar -C /usr/local -xzf go1.21.5.linux-amd64.tar.gz

Why? `/usr/local` is the conventional place for user‑installed software that isn’t managed by the system’s package manager.

Step 3 – Add Go to your PATH
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile
source ~/.profile

Why? Without this, you’ll keep typing `go` and getting “command not found.” The `~/.profile` tweak ensures new shells know where to find the compiler.

Step 4 – Verify installation
go version

You should now see `go1.21.5`. If it still complains about missing binaries, double‑check that `/usr/local/go/bin` is indeed in your `$PATH`.

> Observation: Some users try installing Go via Snap and then find their `~/.cache/snap/go/` folder eating up gigabytes of disk space for nothing. Skip the snap; the tarball gives you a lean install.

Verify your installation

No matter which route you took, run this to confirm everything’s wired up:

go env GOPATH   # should point somewhere like /home/youruser/go
mkdir -p "$GOPATH/src/example.com/foo"
echo 'package main; import "fmt"; func main() { fmt.Println("Hello, world!") }' > "$GOPATH/src/example.com/foo/main.go"
cd "$GOPATH/src/example.com/foo" && go run .

If you see `Hello, world!`, Go is not only installed – it’s ready to compile real projects.

Keep Go updated

Fedora’s repos update slower than Go’s own release cycle. If you want the latest features or bug fixes:

  • From RPM Fusion: `sudo dnf upgrade golang`
  • From the tarball: repeat the download, extraction, and path steps with a newer version number.

> Tip: Set up a simple cron job to check for new releases at https://go.dev/dl/ and alert you when a patch comes out. That way your projects stay on the bleeding edge without constant manual checks.