Rocky Linux 9 DNF Modules: Selecting Application Streams the Right Way
Rocky Linux 9 lets you choose exact Node.js or PostgreSQL streams via dnf modules. This post shows how to enable a stream, install the package, and verify it, plus key trade‑offs and a quick sanity‑check checklist.
24 Apr 2026, 16:36 UTC

Why the Module System Matters in Rocky Linux 9
Rocky Linux 9 ships with the dnf5 backend, which implements the module API used by Red Hat Enterprise Linux 9. Modules bundle a set of packages, configuration files, and runtime dependencies that together form a coherent application stack – for example, the Node.js 20 stream contains nodejs, npm, and the matching libnode libraries. Selecting a stream lets you lock the stack to a specific version while still keeping the rest of the OS on the rolling RHEL 9 baseline.
Basic Workflow – List, Enable, Install
- List available streams
This shows every module, its streams, and the current enabled state. Look for the# dnf module listenabledcolumn to see which streams are active. - Enable the desired stream
The command writes a config file under# dnf module enable nodejs:20/etc/dnf/modules.d/nodejs-20.modulewithenabled=1andstream=20. If you need to switch to a different stream, firstdnf module disable nodejsand then enable the new one. - Install the application package
Because the module is enabled,# dnf install nodejsdnfpulls the exact Node.js 20 build and its dependencies, ensuring no accidental mix‑ups with other streams.
Concrete Example: Node.js 20 on a Fresh Rocky Linux 9 Server
Assume a clean Rocky Linux 9 installation with no Node.js packages yet. Run the steps below as root or a user with sudo privileges.
# dnf module list nodejs
# dnf module enable nodejs:20
# dnf install nodejs
# node -v
v20.12.0
# npm -v
9.8.1
After the install, verify the module state:
# dnf module list --enabled | grep nodejs
nodejs 20 enabled Node.js 20
Check the config file:
# cat /etc/dnf/modules.d/nodejs-20.module
[main]
name=nodejs
stream=20
enabled=1
These checks confirm the stream is active and the installed package matches the advertised version.
Trade‑offs and Limitations
- Dependency resolution caution: If a stream pulls in a newer dependency that conflicts with an already installed package,
dnfmay propose to remove or downgrade that package. Use--allowerasingonly after reviewing the proposed actions. - Third‑party streams: Modules maintained by the community or third‑party vendors are not officially supported by Rocky Linux or Red Hat. They may miss security errata or contain untested configurations, leading to instability.
- Lifecycle alignment: Streams follow the 10‑year support window of Rocky Linux 9. Once the support window ends, the stream will stop receiving updates, so plan upgrades accordingly.
Actionable Checklist Before Committing a Stream Switch
- Run
dnf module list --enabledto confirm current streams. - Back up
/etc/dnf/modules.d/– a quickcp -r /etc/dnf/modules.d /etc/dnf/modules.d.baksuffices. - Test the enable‑install sequence on a staging system.
- Verify the installed package version with
rpm -q package. - Document the stream choice in your configuration management or inventory system.
By following this workflow, you can confidently harness Rocky Linux 9’s module system to keep your application stacks consistent, secure, and aligned with the platform’s support lifecycle.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.