
Table of Contents
- Introduction to DNF Software Modules
- What are DNF Software Modules?
- Key Concepts DNF command
- Managing Software Modules with DNF Command
- To list available modules, use the following dnf command:
- To get more information about a specific module, including its streams and profiles, use following dnf command:
- To enable a specific dnf software module stream, you can use the following:
- To disable a dnf software module, use the following command:
- To update all installed dnf software modules to their latest versions, run following command:
- Resetting a dnf software Module: If you want to reset a module to its default stream, use following command:
- Conclusion
Introduction to DNF Software Modules
DNF Software Modules (Dandified YUM) is the next-generation package manager for RPM-based distributions, such as Fedora, CentOS, and RHEL. It is designed to manage software packages efficiently and provides a rich set of features for package management, including dependency resolution, modularity, and improved performance over its predecessor, YUM.
What are DNF Software Modules?
In the context of DNF, software modules allow users to manage different versions of software packages in a more organized way. This is particularly useful for applications that may have multiple versions or variants that can be installed side-by-side. Modules help in isolating the environment and dependencies of different software versions.
Key Concepts DNF command
- Module Streams: A stream is a collection of packages that represent a specific version or variant of a software. Each stream can have multiple profiles, which define a set of packages to be installed together.
- Profiles: Profiles are predefined sets of packages within a module stream. They allow users to install a specific configuration of a module easily.
- Default Stream: Each module can have a default stream that is selected if no specific stream is mentioned during installation.
Managing Software Modules with DNF Command
Here are some essential DNF commands for managing software modules:
To list available modules, use the following dnf command:
# dnf module list
For example
# dnf module list
Last metadata expiration check: 0:33:31 ago on Mon Aug 14 17:10:38 2023.
AlmaLinux 9 - AppStream
Name Stream Profiles Summary
maven 3.8 common [d] Java project management and project comprehension tool
nginx 1.22 common [d] nginx webserver
nodejs 18 common [d], development, minimal, Javascript runtime
s2i
php 8.1 [e] common [d], devel, minimal PHP scripting language
postgresql 15 client, server PostgreSQL server and client module
ruby 3.1 common [d] An interpreter of object-oriented scripting language
AlmaLinux 9 - CRB
Name Stream Profiles Summary
swig 4.1 common [d], complete Connects C/C++/Objective C to some high-level programming languag
es
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

This command will display a list of all available modules, including their names, stream versions, and descriptions. Modules often represent different software stacks, language versions, or application variants.
To get more information about a specific module, including its streams and profiles, use following dnf command:
dnf module info <module_name>
To enable a specific dnf software module stream, you can use the following:
# sudo dnf module enable module-name:stream-version
For example, to enable the “php” module with stream version “8.1”, you’d use:
# sudo dnf module enable php:8.1
To disable a dnf software module, use the following command:
# sudo dnf module disable module-name
For example, to disable the “php” module, use:
# sudo dnf module disable php
Disabling a module stops DNF from installing packages from that module.
To update all installed dnf software modules to their latest versions, run following command:
dnf module update
Resetting a dnf software Module: If you want to reset a module to its default stream, use following command:
dnf module reset <module_name>
Conclusion
Managing software modules with DNF in Linux provides a powerful way to handle different versions and configurations of software packages. By utilizing the modularity feature, users can easily switch between different streams and profiles, ensuring that their applications run with the required dependencies and versions. DNF’s intuitive commands and capabilities make it an essential tool for system administrators and developers working in RPM-based environments.
For more detail of dnf command please check this dnf man page.
==================================================================================
Was this article of use to you? Post your insightful thoughts or recommendations in the comments section if you don’t find this article to be helpful or if you see any outdated information, a problem, or a typo to help this article better.
==================================================================================