Enable the PowerTools Repository on Rocky Linux 8/9: A Practical Guide
Enable Rocky Linux PowerTools to access development packages like gcc and make. Follow a simple three‑step process: enable the repo, refresh metadata, install and verify. Understand security limits and common pitfalls before turning on PowerTools.
17 Jan 2026, 22:13 UTC

Why You Need PowerTools
Rocky Linux’s default BaseOS and AppStream repositories ship the core operating system and most application packages. However, many development tools—gcc, make, kernel-devel, and various optional modules—live in the PowerTools repository. If you’re setting up a build environment or compiling kernel modules, you’ll quickly hit a “package not found” error unless PowerTools is enabled.
Quick Takeaway
To unlock development packages on Rocky Linux 8 or 9, run:
sudo dnf config-manager --set-enabled powertools
sudo dnf makecache
After that, you can install gcc, make, or any other PowerTools package. Remember: PowerTools is not covered by the standard security errata stream, so monitor updates manually.
Step‑by‑Step Configuration
- Verify the Repository File
Check that the
powertoolsrepo file exists in/etc/yum.repos.d/:cat /etc/yum.repos.d/rocky-powertools.repoTypical output contains a section like:
[powertools] name=Rocky Linux $releasever - PowerTools baseurl=https://dl.rockylinux.org/pub/rocky/$releasever/$basearch/powertools/os/ enabled=0 gpgcheck=1 - Enable the Repository
Run the
config-managercommand. This writesenabled=1into the repo file.sudo dnf config-manager --set-enabled powertoolsCheck the status with
dnf repolist:sudo dnf repolist | grep powertools # Expected output: powertools (enabled) - Refresh Metadata
After enabling, update the local cache so
dnfknows what packages are available.sudo dnf makecacheMissing this step will result in errors like
Failed to download metadata for repo 'powertools'when you try to install a package. - Install a Test Package
Verify that the repository is functional by installing a known PowerTools package.
gccis a common choice.sudo dnf install gccDuring installation,
dnfwill show thatgccis coming from thepowertoolsrepo. After installation, confirm the origin:rpm -q --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH} from %{REPO}\n" gcc # Expected: gcc-13.2.0-1.el9.x86_64 from powertools
Common Pitfalls
- Forgetting
dnf makecache– leads to metadata errors. - Enabling PowerTools on production systems – the repo is not part of the regular security errata stream.
- Version conflicts – packages in PowerTools may have newer versions than those in BaseOS/AppStream, causing dependency clashes.
- FIPS mode incompatibility – some PowerTools packages are not FIPS‑compatible; verify
systemctl is-enabled fipsbefore enabling.
Security and Compliance Considerations
PowerTools packages are built from the same source as BaseOS/AppStream but are not automatically scanned for security vulnerabilities by the Rocky Linux errata system. If your environment requires strict compliance, you should:
- Set up a separate
dnfchannel that mirrors PowerTools and applies your own errata policy. - Regularly run
dnf updateinfo list security powertoolsto check for available patches. - Consider disabling PowerTools after installing the necessary packages and locking the installed versions with
dnf install --setopt=install_weak_deps=False --setopt=protected_multilib=Falseif you want to avoid unintended upgrades.
Verifying the Result
After installation, you can confirm that the package originates from PowerTools by inspecting the RPM header or querying the repo list:
rpm -qi gcc | grep -i repo
# Expected: Repository: powertools
Additionally, run:
dnf repoquery --qf "%{name}-%{version}-%{release}.%{arch} from %{repo}\n" gcc
If the output shows powertools, the configuration is correct.
When to Disable PowerTools
After you’ve installed all required development packages, you can disable the repo to reduce the attack surface:
sudo dnf config-manager --set-disabled powertools
Remember to run sudo dnf makecache again to clear stale metadata.
Summary
Enabling PowerTools on Rocky Linux 8/9 is a straightforward process that unlocks a rich set of development tools. Use the config-manager command, refresh the cache, and verify the repository status. Keep in mind the security implications and avoid enabling the repo on production systems unless you have a mitigation strategy.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.