Enable a Specific AlmaLinux AppStream Stream (e.g., Python 3.11) and Understand Its Impact
Learn how to enable a specific AlmaLinux AppStream module stream—like Python 3.11—using dnf, pin the package version, and understand the impact on system updates and stability.
13 Sept 2026, 09:19 UTC

Why You Should Enable a Module Stream First
AlmaLinux 8 and 9 ship the AppStream repository out of the box, which exposes several "modules"—collections of related packages that can be swapped in and out. The most common use case is to run a newer or older version of a core language, such as Python 3.11, while keeping the rest of the system on the default stream. Enabling a stream pins the package versions for that module, preventing the default stream from being upgraded automatically during normal system updates.
Step‑by‑Step: Enable and Install Python 3.11
List available streams for the module you want. The command shows all enabled and disabled streams, along with their status.
sudo dnf module list pythonLook for a line like
python: 3.11 (stream)and note whether it isenabledordisabled.Enable the desired stream. Replace
pythonwith the module name and3.11with the stream you want. The command must be run as root or withsudo.sudo dnf module enable python:3.11After this step, the module’s packages are now part of the installable set, and the stream becomes the default for that module until explicitly changed.
Verify the status to confirm the stream is enabled and pinned.
dnf module status pythonOutput will show
python: 3.11 (stream) [enabled]and list the packages that belong to the stream.Install the package. The module stream now controls the version of
python3you install.sudo dnf install python3DNF will pull the
python3package from the 3.11 stream, not the default stream.Confirm the runtime version.
python3 --versionThe output should read
Python 3.11.x(the exact patch level depends on the module’s release).
What Happens to System Updates?
Because the stream is pinned, the default dnf update will not bump the python3 package to a newer stream (e.g., 3.12) unless you explicitly enable that stream. This provides stability for applications that depend on a specific Python ABI. However, it also means that security patches for the pinned stream will only be applied if the module maintainers release them; the base system’s dnf update will not automatically pull them.
Common Mistakes and How to Avoid Them
- Not checking for hidden modules: Some modules are disabled by default. Running
dnf module list pythonwill show them with adisabledtag. Enable them first. - Assuming the stream is up‑to‑date: Module metadata can lag behind upstream releases. Verify the exact version with
dnf module info python:3.11before installing. - Overriding system packages unintentionally: Enabling a stream pins the package, which may break dependencies that expect the default stream. Test your application in a staging environment before enabling on production.
- Forgetting to pin the stream: If you enable a stream but later disable it, the system will revert to the default stream. Check
dnf module statusafter any changes.
Limitations of the Module System
While modules provide a convenient way to select specific runtime or build environments, they are not a full replacement for containerization or virtual environments when you need isolation across multiple projects. Additionally:
- Modules are managed at the repository level; you cannot install two different streams of the same module on the same system simultaneously.
- Package pinning can interfere with
dnf upgrade --refreshif you rely on the latest security patches from the default stream. - Some modules expose only runtime streams; build streams (e.g.,
python:3.11-build) must be enabled separately if you need compiler tools.
Practical Check: Verify the Stream Is Active
After installing, run:
dnf module status python | grep 3.11
If the output shows [enabled], the stream is active. To double‑check that python3 is coming from the module, inspect the package source:
rpm -qi python3 | grep -i "stream"
The Stream field should read 3.11.
Conclusion
Enabling a specific AppStream stream on AlmaLinux is a powerful way to control the exact runtime environment your applications use. By following the commands above, you can safely enable Python 3.11, install it, and verify that the stream is pinned. Keep in mind the trade‑offs: pinning can prevent automatic security updates and may break dependencies that expect the default stream. Test changes in a non‑production environment, monitor module updates, and use dnf module status to keep the system under control.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.