redhat modules dnf yum - ghdrako/doc_snipets GitHub Wiki

DNF is fully compatible with YUM and provides YUM-compatible command lines and APIs for extensions and plug-ins. *https://dnf.readthedocs.io/en/latest/command_ref.html

Modules

A module is a set of RPM packages that represent a component and are usually installed together. A typical module contains packages with an application, packages with the application-specific dependency libraries, packages with documentation for the application, and packages with helper utilities. Module streams - organization of content by version. Module profiles - organization of content by purpose.

Module profiles

A profile is a list of recommended packages that are installed together for a particular use case, such as a server, client, development, minimal install, or other.

Example profile for httpd:

  • common - a hardened production-ready deployment, the default profile.
  • devel - the packages necessary for making modifications to httpd.
  • minimal - the smallest set of packages that provide a running web server.
sudo dnf -qy disable postgres 
  • -q - Suppresses messages notifying about the current state or actions of DNF
  • -y - Automatically answer yes for all questions.

Listing of avaliable modules

$ dnf module list
$ yum module list

$ yum module info module-name
$ yum module info postgresql
$ yum module info --profile module-name
$ yum module info --profile postgresql:10

$ yum module list module-name # current status of a module, including enabled streams and installed profiles

$ dnf module list | grep ruby

Enabling modules

$ dnf module enable NAME:STREAM
$ dnf module enable nodejs:8

# yum module enable module-name:stream

Packages from enabled module streams can be then installed by the dnf install NAME command.

The command module install will install the default profile (set of packages). Once the stream is enabled, it’s also possible to install its RPM packages with usual dnf install. Stream packages would be prefered to base system packages.

Installing modules

$ dnf module install NAME
$ dnf module install NAME:STREAM
$ dnf module install NAME/PROFILE
$ dnf module install NAME:STREAM/PROFILE

$ yum module install postgresql # Install the postgresql module by using the default stream and profile
$ yum module list postgresql    # in instaled stram and profile is ``[i]``

# yum module install module-name:stream # automatically enable selected stream and if a default profile is defined for the stream, this profile is automatically installed
$ yum module install module-name:stream/profile
# yum module install postgresql:13  # Because the installation profile was not specified, the default profile server was used. 

$ dnf module install nodejs:8
$ dnf module install mongodb/client

Remove the module

$ sudo dnf module remove module-name


# yum module install php:7.3/* # Install the php:7.3 module stream, including all available profiles
# yum module remove php:7.3/devel # Remove packages only from the devel profile

Switch to a different stream

$ sudo dnf module reset module-name
$ sudo dnf module enable module-name:stream
$ sudo dnf module install module-name:stream
$ sudo dnf distro-sync
sudo dnf module remove nodejs
sudo dnf module disable nodejs

sudo dnf module reset nodejs

sudo dnf module enable nodejs:14
sudo dnf module install nodejs:14