Install Go on Rocky Linux
| EPEL and repositories | |
| Install with dnf | |
| go version | |
| Version notes |
EPEL and repositories
Rocky Linux ships Go through the standard repositories, and many servers also enable EPEL for extra packages.
For this lesson the base repositories are enough, so there is no need to add third party sources by hand.
Install with dnf
Install the Go toolchain with a single dnf transaction.
sudo dnf install golang
The package manager will pull in the compiler, the standard library, and the go command itself.
Confirm the prompt to import repository keys when dnf asks for approval.
go version
A fresh install should answer with its version number.
go version
go version go1.21 linux/amd64
If the command is not found, open a new shell so the PATH changes from the install take effect.
Version notes
Enterprise style distributions value stability, so the packaged Go release can be older than the newest upstream release.
Stay with dnf for servers that need long term support, and use the release archive from the official download page only when you must have the latest language features.
Next: Install Go on macOS
Article author: Arthur Isaev