LinuxCommandLibrary

dnf-module

Control DNF module streams

TLDR

View the modularity overview

$ dnf module list
copy

View modularity of a specific program
$ dnf module list [package_name]
copy

Set a package to be enabled
$ sudo dnf module enable [package_name]:[stream]
copy

Enable and install a specific version
$ dnf module install [package_name]:[stream]
copy

SYNOPSIS

dnf module [options] <command>
<command> can be one of: list, enable, disable, install, remove, info, reset, update, provides.

Common usage examples:
dnf module list [module] [options]
dnf module enable module:stream [...]
dnf module install module[:stream[:profile]] [...]
dnf module disable module [...]
dnf module reset module [...]

PARAMETERS

list
    Lists available modules, their streams, and profiles. Can be filtered by module name or options like --enabled.

enable <module>:<stream>
    Enables a specific module stream. This makes packages from that stream available for installation and disables any conflicting streams.

disable <module>
    Disables a module, making its packages unavailable. This does not remove already installed packages but prevents further installation from that module.

install <module>[:<stream>[:<profile>]]
    Installs packages defined by a module profile. If no profile is specified, the 'default' profile is often used. If no stream, the default enabled stream is used.

remove <module>[:<stream>[:<profile>]]
    Removes packages previously installed as part of a module profile. Use with caution as it can remove dependencies.

info [<module>[:<stream>[:<profile>]]]
    Displays detailed information about specified modules, streams, or profiles, including descriptions and package lists.

reset <module>
    Resets the module's state to its default. This typically disables the module and makes its default stream available again.

update [<module>[:<stream>]]
    Updates packages within enabled module streams. Can be used to update all or specific modules.

provides <what>
    Searches which module provides a specific package or capability.

--all
    Used with 'list' to show all modules, including enabled, disabled, installed, and available ones.

--enabled
    Used with 'list' to show only enabled module streams.

--disabled
    Used with 'list' to show only disabled module streams.

--installed
    Used with 'list' to show only installed module streams and profiles.

--available
    Used with 'list' to show only available module streams.

--stream <stream_name>
    Filters module operations by a specific stream name.

--profile <profile_name>
    Specifies a module profile for 'install' or 'remove' operations.

DESCRIPTION

dnf-module is a powerful subcommand of the DNF package manager, designed for managing software modules. Modules encapsulate software components and their dependencies, offering different streams (versions or release lines) and profiles (curated sets of packages for specific use cases) of applications. This command allows users to discover, enable, disable, install, and manage these module-defined software stacks. It addresses challenges like dependency conflicts and provides a more controlled, stable, and flexible way to consume software than traditional package management alone, especially for applications with rapid development cycles or multiple maintained versions. It's crucial for maintaining consistent and predictable application environments on systems like Fedora and Red Hat Enterprise Linux.

CAVEATS

Module operations can significantly alter the available software stack on your system.
Enabling a module stream might automatically disable other conflicting streams of the same module, which could impact existing applications.
Most dnf module commands require root privileges.
Careful consideration of streams and profiles is essential to avoid unexpected package conflicts or software behavior.

MODULE STREAMS

A module stream represents a specific version or release line of a software component (e.g., nodejs:16, nodejs:18). Enabling a stream makes packages from that specific version available for installation. Only one stream of a given module can be enabled at a time.

MODULE PROFILES

A module profile is a curated set of packages within a specific module stream, tailored for a particular use case (e.g., nodejs/default, nodejs/development, nodejs/minimal). Profiles simplify the installation of complex applications by grouping necessary dependencies and tools together.

HISTORY

The concept of modules was introduced with DNF version 2 and YUM version 4, becoming a cornerstone feature in Red Hat Enterprise Linux 8 and Fedora 28 onwards. This innovation aimed to provide greater flexibility in managing software lifecycles and dependencies, allowing multiple versions of applications (e.g., Python, Node.js) to coexist or be managed independently on the same system. The dnf-module subcommand specifically provides the interface to interact with this modularity framework, evolving from initial dnf module experimental commands to a stable and essential part of DNF's capabilities.

SEE ALSO

dnf(8), dnf.conf(5), rpm(8)

Copied to clipboard