How to use the Fedora modular repository

The Fedora dnf module tool provides a new way to think about installing on the Linux platform.

How to use the Fedora dnf modular repository Jack Wallen illustrates how to make use of the new Fedora dnf modular repository.

If you're a user of either the Fedora Desktop or Server, you understand that sometimes the distribution can be a bit too bleeding edge. If you prefer this distribution, but would rather control how fast things get updated, there's a solution that was deployed in the 28th iteration of the platform.

That solution is modularity. With the help of a dnf subcommand, you can have access to a set of modules that define alternative versions of popular software. So, if Fedora's default upgrade path is too fast for you, you can retain access to older frameworks and/or toolchains that support a wider variety of applications.

Unlike Software Collections, the modular approach doesn't install multiple versions of software in parallel. Instead, with the modular repository, only one version will be installed on a system, and the user is in charge of selecting which version.

SEE: System update policy template download (Tech Pro Research)

I want to demonstrate how to use the modular repository to install a specific release of MongoDB on Fedora Server 29.

What you need

The only thing you'll need is a working installation of Fedora Server (or Desktop) and a user account with sudo privileges.

Listing modules

The first thing to do is list out the available modules. This will list out the versions of the software that can be installed. To do this, log into the server (or open a terminal window) and issue the command:

dnf module list

The output of the command will list out all of the available modules for the platform (as well as the versions ready for installation as seen in Figure A).

Figure A

Figure A

MongoDB is included in the module listing.


As you can see, there are two versions (aka "streams") of MongoDB available, 3.4 and 3.6. If you don't want to scroll through the entire list, you could specify a target package like so:

dnf module list mongodb

The output of that command will only list out MongoDB (Figure B).

Figure B

Figure B

MongoDB alone in the listings.


Installing a module

Each module is listed by Name, Stream, Profile, and Summary. We want to install by Stream and Profile. We'll install MongoDB Steam 3.4 and Profile Server. To do this, issue the command:

sudo dnf module install mongodb:3.4/server

This will catch all the necessary dependencies for the steam and profile requested and install everything required for the package to run properly.

If you're not certain that's the stream/profile you want, you can get more information on that particular combination with the command:

dnf module info mongodb:3.4/server

As you can see (Figure C), that command will list out a description of the software to be installed, as well as the artifacts (dependencies).

Figure C

Figure C

More information about the version of MongoDB to be installed.


Installing a different stream/profile

What if you want to switch a stream or profile? Say, for instance, you want to move from MongoDB 3.4/server to 3.6/default? All you have to do is install the new Stream/Profile, which will replace the old. At the moment, we have 3.4/server installed. To go to 3.6/default, issue the command:

sudo dnf module install mongodb:3.6/default

As you can see (Figure D), the summary clearly indicates the 3.4/server instance is to be replaced with 3.6/default.

Figure D

Figure D

Replacing the current Stream/Profile.


After that installation, you're good to go.

A new way to think (about installation)

The Fedora dnf module tool gives you a new way to think about installing on the Linux platform. This modular approach gives you even more flexibility than you might have ever enjoyed on a bleeding edge operating system.

Also see

fedorahero.jpg
Image: Fedora

By Jack Wallen

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.