Using DNF Module Streams in AlmaLinux to Install Specific Package Versions
Learn how to enable, install, and switch DNF module streams in AlmaLinux to get exact package versions, with verification steps and common pitfalls.
06 Oct 2025, 18:11 UTC

Using DNF Module Streams in AlmaLinux
AlmaLinux includes DNF modularity, which lets you install different versions of the same package from separate module streams. This guide shows how to enable a stream, install the package, verify the version, and revert to the default.
Example: Installing Node.js 14 from the nodejs module
- List available streams for the module:
- Enable the desired stream (here 14):
- Install the module:
- Verify the installed version matches the stream:
dnf module list nodejs
sudo dnf module enable nodejs:14
sudo dnf install nodejs
rpm -q nodejs
Switching to a different stream
To change from one stream to another, disable the current stream, enable the target, and reinstall:
sudo dnf module reset nodejs
sudo dnf module enable nodejs:16
sudo dnf install nodejs
After switching, run sudo dnf distro-sync to remove obsolete packages from the previous stream.
Limits and common pitfalls
- Only packages that have been modularized in the upstream RHEL source appear as streams; many traditional packages are not available this way.
- Streams of interdependent modules (for example, a module that depends on a specific version of another module) can cause dependency conflicts if you enable incompatible streams.
- Manually editing files in
/etc/dnf/modules.d/without a backup can introduce syntax errors that break DNF operations. - Failing to run
dnf module resetbefore enabling a new stream may leave the old stream enabled, leading to unexpected package versions.
Verification and rollback
Check which streams are enabled:
dnf module list --enabled
Look for the [e] marker next to the stream name.
To revert to the default stream:
sudo dnf module reset nodejs
sudo dnf distro-sync
After the reset, confirm the default stream is active with dnf module list nodejs and reinstall the package if needed.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.