Managing Application Streams on Rocky Linux with DNF Modules
Learn how to use Rocky Linux’s DNF module system to pick specific application versions, keep your OS stable, and manage side‑by‑side deployments. A step‑by‑step guide with real commands, trade‑offs, and a concrete PostgreSQL example.
12 Apr 2026, 20:46 UTC

Why Application Streams Matter on Rocky Linux
Rocky Linux inherits Red Hat Enterprise Linux’s Application Stream (AppStream) mechanism, which lets you pick a specific version of an application without touching the core OS. This is handy when you need two different PHP or Python runtimes on the same host, or when a newer library version contains a security fix that you want to test before upgrading the whole system.
Getting Started: Listing Available Streams
Before you enable a module you should see what streams exist. Run the following as root or with sudo:
dnf module list php
Output will show streams such as 7.4, 8.0, and 8.1, along with their status (enabled, disabled, or available). The list can be filtered with dnf module list php:8.0 to see only the desired stream.
Enabling and Installing a Stream
Once you know which stream you want, enable it and install the application:
# Enable the desired stream
sudo dnf module enable php:8.0
# Install the application package(s)
sudo dnf module install php
The module enable command records the stream in /etc/dnf/modules.d/, so the choice persists across system upgrades. The module install command pulls the appropriate RPMs and their dependencies from the AppStream repository.
Updating and Resetting a Module
To move to a newer stream or apply a patch, use:
# Update the module to the latest stream
sudo dnf module update php
If you need to revert to the default stream or disable the module entirely, use:
# Reset the module to its default state
sudo dnf module reset php
# Disable the module (removes all packages installed via the module)
sudo dnf module disable php
After disabling, you can still install the application from the base repository if needed.
Concrete Example: PostgreSQL 13 vs 14
Suppose you have an application that works with PostgreSQL 13, but a newer service requires PostgreSQL 14. AppStreams let you run both side‑by‑side:
# Enable PostgreSQL 13 stream
sudo dnf module enable postgresql:13
sudo dnf module install postgresql
# Enable PostgreSQL 14 stream
sudo dnf module enable postgresql:14
sudo dnf module install postgresql
Each stream installs its own set of packages (e.g., postgresql-server-13 vs postgresql-server-14). You can then start each instance on different ports or in separate containers. Verify installation with:
rpm -qa | grep postgresql | grep -E '13|14'
Check /etc/dnf/modules.d/postgresql.conf to see which stream is active for each package group.
Trade‑Offs and Limitations
- Not All Software is a Module: Legacy or niche packages often stay in the base repository. If an application you need isn’t exposed as a module, you’ll have to install it manually via
dnf installor build from source. - Stream Deprecation: Modules can be deprecated or moved to a different repository. Relying exclusively on modules may mean missing critical updates if a stream is retired.
- Complex Dependency Graphs: Enabling a new stream can pull in many packages. Always review the transaction summary before confirming to avoid unintentional upgrades.
- State Persistence: Module state is written to files in
/etc/dnf/modules.d/. If you manually edit these files, you risk leaving the system in an inconsistent state.
Practical Checklist for Engineers
- Run
dnf module list <app>to inventory available streams. - Choose the stream that matches your compatibility matrix.
- Enable the stream with
dnf module enable <app>:<stream>. - Install the application via
dnf module install <app>and confirm withrpm -qa | grep <app>. - Document the module configuration in your deployment playbooks or Git repository.
- Periodically run
dnf module update <app>and review changelogs for security patches. - If you need to roll back, use
dnf module reset <app>ordnf module disable <app>.
Actionable Next Steps
1. Audit your current Rocky Linux servers for modules: dnf module list --enabled.
2. Map application versions to module streams in your inventory tool.
3. Update your CI/CD pipelines to use dnf module enable before building images.
4. Educate your ops team on the difference between module streams and base packages.
5. Monitor the Rocky Linux community mailing list for any upcoming deprecations of critical streams.
Diagram
| Component | Role |
|---|---|
| Base Packages | Core OS components, always present. |
| Module Stream | Per-application version selection. |
| DNF Module Manager | Enables, installs, updates, resets modules. |
| Application Layer | Runtime environment (e.g., PHP 8.0, PostgreSQL 14). |
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.