The Fedora distribution Allows user to install multiple version of RPM packages using Modularity Repository

The Fedora distribution has introduced a new concept called Modularity Repository, which enables Fedora users to install different versions of a package from the distribution’s repositories.

This is not added recently in Fedora, it was shipped with Fedora 28 server edition as an optional repository with additional content.

A lot has changed since then, and now Modularity is a core part of the Fedora distribution.

As per June 12, 2019, out of the 49,464 binary RPM packages in Fedora 30 — 1,119 (2.26%) come from a module.

Navigate to this link if you want to learn more about DNF Package Manager

What is Modularity?

Modularity introduces a new optional repository to Fedora called Modular (often referred to as the “Application Stream” or AppStream for short) that ships additional versions of software on independent life cycles.

This enables users to keep their operating system up-to-date while having the right version of an
application for their use case, even when the default version in the distribution changes.

Modularity is a mechanism of making multiple versions of software available to your system.
Modules are special package groups usually representing an application, a language runtime, or a set of tools.

How To Install Packages from Modularity Repository?

Packages available to the system can be discovered by the usual commands such as dnf search NAME and dnf list NAME, etc.,

How To List Modules?

To list available modules in your system, to see what streams are default or have been enabled, use the following command.

$ dnf module list

How To Install modules?

To install a module, use one of the following commands. If you are not specifying a stream or a profile then DNF will choose the default version.

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

For Example:

$ dnf module install nodejs
$ dnf module install nodejs:10
$ dnf module install postgresql/server
$ dnf module install postgresql:11/server

Let’s install the dwm package and see what will be the output.

$ sudo dnf install dwm
…
Done!

Use the following command to see what module streams are available. The output shows there are four streams of the dwm module, 6.1 being the default.

$ sudo dnf module list | grep dwm
…
dwm                 latest                …
dwm                 6.0                   …
dwm                 6.1 [d]               …
dwm                 6.2                   …
…
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

How To enable and install a different package version?

To install the dwm package in a different version (we are planning to install 6.2 instead of .1).
Enable the stream and then install the package by using the two following .

Run the following command to enable the required STREAM.

$ sudo dnf module enable dwm:6.2
…
Enabling module streams:
  dwm                 6.2
…
Done!

Finally install the enabled STREAM

$ sudo dnf install dwm
…
Done!

References:

Leave a Reply

Your email address will not be published. Required fields are marked *