Go’s fast compiler and static binaries make it a practical fit for Fedora development work, from small command-line tools to services that ship cleanly in containers. To install Go (Golang) on Fedora, use the golang package from Fedora’s DNF repositories; it installs the go and gofmt commands and keeps updates tied to normal system upgrades.
Fedora’s packages currently track maintained upstream Go releases closely, so most users do not need a manual tarball or source build. Official Go downloads remain useful when you need an exact upstream archive, but that path lives outside DNF ownership under /usr/local/go and needs separate update and cleanup work.
Install Go (Golang) on Fedora
The Fedora package name is golang, even though the installed command is go. This is the recommended path for traditional mutable Fedora systems because DNF handles the compiler package, source tree, dependencies, updates, and removal together.
These DNF commands target traditional Fedora Workstation, Server, Spins, and minimal installs. On Fedora Atomic desktops such as Silverblue or Kinoite, install Go inside a toolbox or Distrobox container unless you intentionally layer host packages with
rpm-ostree.
Refresh Fedora Before Installing Go
Refresh package metadata and apply available updates before installing the Go toolchain:
sudo dnf upgrade --refresh
Install Go with DNF
Install the golang package from Fedora’s repositories:
sudo dnf install golang
DNF installs the main metapackage plus the compiler binaries and standard library source tree. On Fedora 44, the important installed packages currently look like this:
rpm -q golang golang-bin golang-src
golang-1.26.3-2.fc44.x86_64 golang-bin-1.26.3-2.fc44.x86_64 golang-src-1.26.3-2.fc44.noarch
Fedora 43 can show a Go 1.25.x package while Fedora 44 shows Go 1.26.x, and later updates can move those point releases forward. The package split is the useful part: golang is the install target, golang-bin owns the commands, and golang-src provides the Go source tree used by the toolchain.
Verify Go on Fedora
Check the active Go command:
go version
Expected output uses the Fedora-packaged Go version and your system architecture. On Fedora 44, it currently looks like this:
go version go1.26.3-X:nodwarf5 linux/amd64
Fedora manages the go and gofmt commands through the alternatives system. Confirm the active path when you need to troubleshoot mixed package and manual installs:
alternatives --display go
go - status is auto. link currently points to /usr/lib/golang/bin/go /usr/lib/golang/bin/go - priority 90 follower gofmt: /usr/lib/golang/bin/gofmt Current `best' version is /usr/lib/golang/bin/go.
Check Go Environment Paths
Go uses a system toolchain directory and a per-user workspace. Print the key values in a stable form:
GOPATH_VALUE=$(go env GOPATH)
printf 'GOROOT=%s\n' "$(go env GOROOT)"
printf 'GOPATH=$HOME%s\n' "${GOPATH_VALUE#"$HOME"}"
printf 'GOPROXY=%s\n' "$(go env GOPROXY)"
GOROOT=/usr/lib/golang GOPATH=$HOME/go GOPROXY=https://proxy.golang.org,direct
GOROOT belongs to Fedora’s package, while GOPATH belongs to your user account. Go modules, downloaded dependencies, and binaries installed with go install usually land under $HOME/go.
Build a Test Go Program on Fedora
A small module build verifies more than the version banner. It confirms that the compiler, module tooling, and local executable output work together.
Create a temporary project directory and initialize a Go module:
mkdir -p ~/go-hello
cd ~/go-hello
go mod init example.com/hello
go: creating new go.mod: module example.com/hello
Create a simple hello.go file:
cat > hello.go <<'EOF'
package main
import "fmt"
func main() {
fmt.Println("Hello from Fedora Go")
}
EOF
Build the module, then run the compiled program:
go build
./hello
Hello from Fedora Go
Remove the temporary project when you are done with the test:
cd ~
rm -rf ~/go-hello
For language tutorials, module workflows, standard library references, and release notes, use the official Go documentation after the Fedora package is installed.
Manage Go on Fedora
DNF-owned Go installations follow Fedora’s normal package lifecycle. Use DNF for updates and removal instead of replacing files under /usr/lib/golang manually.
Update Go with DNF
Update Fedora packages normally. This includes Go when a newer Fedora build is available:
sudo dnf upgrade --refresh
If you want package updates to run automatically on a workstation or development server, set up dnf-automatic on Fedora for scheduled DNF upgrades and the tradeoffs around unattended updates.
Remove Go from Fedora
Remove the Fedora Go package with DNF:
sudo dnf remove golang
DNF removes unused Go dependencies that were installed only for this package. Packages you installed separately for other development work should remain available.
Clear any cached shell path, then verify the main Go packages are no longer installed:
hash -r
rpm -q golang golang-bin golang-src || true
package golang is not installed package golang-bin is not installed package golang-src is not installed
Remove Go Workspace Data
Package removal leaves your user workspace and build cache alone. Keep those directories if you still need downloaded modules, compiled tools, or project cache data.
The next command permanently deletes your Go workspace at
~/goand the Go build cache at~/.cache/go-build. Back up any project binaries, downloaded modules, or local files you still need before running it.
rm -rf ~/go ~/.cache/go-build
Troubleshoot Go on Fedora
Most Fedora Go problems come from a missing package, a mixed manual install, a user PATH that does not include $HOME/go/bin, or network policy blocking the Go module proxy.
Fix go Command Not Found
If the shell cannot find Go, the error usually looks like this:
bash: go: command not found
Check whether the package is installed and whether a go command exists in your current PATH:
hash -r
rpm -q golang golang-bin || true
command -v go || echo "go command not found in PATH"
When Go is missing, relevant output includes:
package golang is not installed package golang-bin is not installed go command not found in PATH
If the package check reports missing packages, reinstall Go with DNF:
sudo dnf install golang
If Go is installed but a manual /usr/local/go setup previously changed symlinks or PATH order, check Fedora’s alternatives entry and switch back to automatic selection:
alternatives --display go
sudo alternatives --auto go
Fix Go-Installed Tools Not Found
Commands installed with go install example.com/tool@latest usually go into $HOME/go/bin. If that directory is not in PATH, the install succeeds but the new command still fails to run.
Check for the Go user binary directory in your PATH:
printf '%s\n' "$PATH" | tr ':' '\n' | grep -Fx "$HOME/go/bin" || echo "GOPATH bin is not in PATH"
If the path is missing, the diagnostic prints:
GOPATH bin is not in PATH
If the check reports that the directory is missing, add it to Bash startup files once, then reload your shell configuration:
mkdir -p "$HOME/go/bin"
touch ~/.bashrc
grep -qxF 'export PATH="$PATH:$HOME/go/bin"' ~/.bashrc || printf '\nexport PATH="$PATH:$HOME/go/bin"\n' >> ~/.bashrc
source ~/.bashrc
Fix Module Download Failures
If go mod download, go get, or go install fails while fetching modules, first check the configured proxy:
go env GOPROXY
https://proxy.golang.org,direct
Networks that block proxy.golang.org may need direct source fetching instead:
go env -w GOPROXY=direct
Direct fetching often needs Git for public and private repositories. Check for Git if the error mentions a missing git command, then review Install Git on Fedora for user identity and SSH-based repository access.
command -v git || echo "git is not installed"
If Git is missing, install it with DNF:
sudo dnf install git
Restore Go’s default proxy setting when direct fetching is no longer required:
go env -u GOPROXY
Conclusion
Go is ready on Fedora through DNF, with the compiler, module tooling, standard library source tree, and user workspace paths verified. For the next part of a development setup, pair it with Install Docker on Fedora for containers or Install Visual Studio Code on Fedora for editor support.


Formatting tips for your comment
You can use basic HTML to format your comment. Useful tags currently allowed in published comments:
<code>command</code>command<strong>bold</strong><em>italic</em><blockquote>quote</blockquote>