Using Rocky Linux Module Streams to Install Specific Versions of Software
Learn how to enable, use, and reset DNF module streams on Rocky Linux to get exact versions like Node.js 14, with steps, trade‑offs, and a reset procedure.
03 Feb 2026, 03:45 UTC

Problem: Needing a Specific Node.js Version on Rocky Linux
When deploying a web application on Rocky Linux, the default Node.js package in the base repositories may be newer than the version your code expects. Installing an incompatible release can cause runtime errors or broken builds, while manually compiling Node.js adds maintenance overhead. The challenge is to obtain a specific, supported version without leaving the managed package ecosystem.
What Are Module Streams?
Rocky Linux inherits the modularity system from Red Hat Enterprise Linux. A module is a group of related packages (for example, Node.js and its npm companion) that can be made available in multiple streams, each stream representing a different version line. The streams are defined in the repository metadata and are visible through the dnf module subsystem. Enabling a stream tells DNF to treat that stream as the default source for the module’s packages, so subsequent dnf install or dnf upgrade operations pull the selected version automatically.
Enabling a Stream: Example with Node.js 14
- Open a terminal on your Rocky Linux host. You need root privileges; either log in as root or prefix commands with
sudo. - Enable the Node.js 14 stream:
This command modifies the module metadata insudo dnf module enable nodejs:14/var/cache/dnfand records the enablement in/etc/dnf/modules.d/. - Confirm the change:
Look fordnf module list --enablednodejsin the list with a status ofe(enabled). - Install the Node.js package:
DNF will resolve dependencies against the enabled stream, pulling the 14.x series of the nodejs binary and its npm counterpart.sudo dnf install nodejs - Verify the installed version:
The output should begin withnode --versionv14, indicating that the stream’s version is active.
Trade‑offs and Limitations
- Enabling a stream changes the default provider for all packages in that module. If another application relies on the distribution’s default Node.js version, it may now receive the 14.x build, which could introduce incompatibilities.
- Streams are tied to a major release of Rocky Linux. Attempting to enable a stream built for Rocky Linux 8 on a Rocky Linux 9 system (or vice‑versa) is not supported and can lead to unsatisfied dependencies or broken transactions.
- Resetting a stream removes the enablement and restores the default stream. Running
will disable the custom stream and cause DNF to revert to the default version. Any packages that were installed from the non‑default stream may be downgraded, removed, or replaced, so you should test dependent applications afterward.sudo dnf module reset nodejs - Only one stream per module can be enabled at a time. Parallel installation of two different Node.js versions via modules is not possible; you would need to use alternative methods such as containers or software collections for that scenario.
Actionable Checklist
- Survey available streams:
dnf module list - Choose the stream that matches the version you need (e.g.,
nodejs:14). - Enable it with
sudo dnf module enable name:stream. - Install the desired package and verify the version with the appropriate command (
node --version,python3 --version, etc.). - Record the enabled stream in your automation scripts or configuration management database so that future reproductions know which stream is active.
- If you need to revert, run
and re‑check any applications that depend on the module’s packages.sudo dnf module reset name
By using Rocky Linux’s module streams, you gain a supported, repository‑based way to lock in the exact versions your workloads require while still benefiting from routine security updates within that stream.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.