The Fedora dnf module tool provides a new way to think about installing on the Linux platform.
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.
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).
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).
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).
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.
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.
- New features in Fedora 29 make life easier for web developers (TechRepublic)
- First beta of Red Hat Enterprise Linux 8 now available with security updates, new features (TechRepublic)
- How to install applications from the command line using apt, dnf, and zypper (TechRepublic)
- How to find the right Linux distribution for you (TechRepublic)
- Fedora 29, hands-on: Installing and upgrading (ZDNet)
- It takes work to keep your data private online. These apps can help (CNET)
- Programming languages and developer career resources coverage (TechRepublic on Flipboard)