Managing Software Versioning in AlmaLinux using AppStream Modules
Learn how to use AlmaLinux AppStream to manage multiple software versions of the same package without upgrading your entire OS, using the dnf module system.
07 Jul 2026, 19:38 UTC

Solving the Version Conflict Problem
In traditional Linux distributions, installing a newer version of a language runtime or database often requires adding third‑party repositories or upgrading the entire operating system. This creates a risk where updating one application breaks the stability of the core OS.
AlmaLinux solves this using AppStream. AppStream allows you to install multiple versions of the same software (called "streams") from the official repositories without compromising the base system stability. The key takeaway is that you can pin your server to a specific version of a tool—such as PHP 8.1 or Node.js 16—and receive security updates for that specific version independently of the OS release cycle.
How AppStream Modules Work
AppStream utilizes a "modular" repository structure. Instead of a flat list of packages, software is grouped into modules. A module consists of a stream (the version) and a profile (a predefined set of packages for a specific use case, like "common" or "devel").
The dnf module command is the primary tool for managing these streams. When you enable a specific stream, you are telling the package manager to ignore all other versions of that software and prioritize the selected version.
Example: Deploying a Specific PHP Version
To install a specific version of PHP on AlmaLinux, follow this workflow. These commands must be run as a user with sudo privileges on the terminal.
# 1. List available PHP streams to identify the desired version
sudo dnf module list php
The output will show several streams (e.g., 7.4, 8.0, 8.1). Once you identify the version you need, enable it:
# 2. Enable the specific stream (e.g., 8.1)
sudo dnf module enable php:8.1
Finally, install the package. Because the 8.1 stream is enabled, dnf knows exactly which version to fetch:
# 3. Install the software
sudo dnf install php
Switching Between Streams
You cannot simply enable a new stream if a different version is already installed; this will cause dependency conflicts. To switch versions, you must reset the module state first.
- Remove the current version:
sudo dnf remove php - Reset the module:
sudo dnf module reset php(This clears the previously enabled stream). - Enable the new stream:
sudo dnf module enable php:8.2 - Install:
sudo dnf install php
Limitations and Common Pitfalls
- Not all packages are modular: Only specific, rapidly evolving software is placed in AppStream. Standard system utilities remain as traditional RPMs and follow the standard OS versioning.
- Stream Conflicts: Enabling two different streams for the same module simultaneously is not permitted. You must choose one.
- Profile Overwrites: If you install a module using a specific profile (e.g.,
dnf module install php:8.1/devel), be aware that this may install a large number of development headers and tools that you might not need for a production environment.
Verification and Diagnostics
To verify that the correct version was deployed, use the binary's own version flag rather than relying on the package manager list.
# Check the active version of the installed software
php -v
To check which modules are currently enabled across the entire system, run:
# List all enabled modules
sudo dnf module list --enabled
If you encounter a "dependency resolution" error during installation, it is usually a sign that a previous module stream was not properly reset using dnf module reset.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.