How to Manage DNF Software Modules in Linux: A Comprehensive Guide

Photo of author
By Jay
— 3 min read
Photo of author
Written by
Photo of author
Verified by
Published On
— 3 min read

DNF Software Module

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

  1. 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.
  2. Profiles: Profiles are predefined sets of packages within a module stream. They allow users to install a specific configuration of a module easily.
  3. 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
dnf software modules

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.
==================================================================================

Related Posts


About Author

Photo of author

Jay

I specialize in web development, hosting solutions, and technical support, offering a unique blend of expertise in crafting websites, troubleshooting complex server issues, and optimizing web performance. With a passion for empowering businesses and individuals online, I provide in-depth reviews, tech tutorials, and practical guides to simplify the digital landscape. My goal is to deliver clear, reliable, and insightful content that helps readers make informed decisions and enhance their online presence.

Leave a Comment