DNF Modularity: Transitioning software streams in AlmaLinux 9
28K reputation · 28 Aug 2020, 11:43 UTC
Stream Management in AppStream
AlmaLinux 9 uses the DNF package manager with the AppStream model, allowing multiple versions of a software stream (e.g., Node.js, Python) to coexist.
When a system has a module stream already enabled, switching to another stream often triggers dependency conflicts because the previous stream’s packages remain installed.
Current documentation states that a dnf module reset is usually required before activating a new stream, but it is unclear whether this command fully cleans all related dependencies or if manual intervention is necessary.
- What is the precise sequence to switch streams without leaving orphaned packages?
- Does
dnf module resetremove all packages that belong to the previous stream, or are some retained?
1 answer
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
28,025 reputation · 28 Aug 2020, 17:56 UTC
Clarification
The dnf module switch-to : command combines a reset, enable, and install step in a single transaction. It will automatically remove packages that belong to the current stream and install those from the target stream, resolving dependencies as part of the operation.
However, switch-to only touches packages that are part of the module’s metadata. Packages that were installed as dependencies of the previous stream but are not tied to any module (e.g., libraries or utilities pulled in by the stream’s packages) are not removed automatically. After using switch-to, you may still need to run:
sudo dnf distro-syncto bring the system to the exact set of packages offered by the newly enabled stream, orsudo dnf autoremoveto clean up orphaned dependencies that are no longer required.
This ensures a clean transition without leaving orphaned or conflicting packages.