Learn how to – How to use Fedora / RHEL 8 Modular Repository.
Fedora / RHEL 8+ systems comes with Modularity Repository feature that allows you to install additional versions of software on independent life cycles through the Application Stream also referred to as AppStream. This enables you to keep your operating system up-to-date while having the right version of an application that suits your use case.
The dnf subcommandmodule
is used to manage Modular Repository on a Fedora system which supports the feature. See below examples on how to use Fedora Modular Repository.
List Available Modules
To list all module streams, their profiles, and states (enabled, disabled, default), run the commands:
sudo dnf module list
You’ll get an output similar to one below:
Fedora Modular 37 - x86_64
Name Stream Profiles Summary
avocado latest default [d], minimal Framework with tools and libraries for Automated Testing
avocado 82lts default, minimal Framework with tools and libraries for Automated Testing
avocado-vt latest default Avocado Virt Test Plugin
avocado-vt 82lts default Avocado Virt Test Plugin
cri-o 1.20 default [d] Kubernetes Container Runtime Interface for OCI-based containers
cri-o 1.21 default [d] Kubernetes Container Runtime Interface for OCI-based containers
cri-o 1.22 default [d] Kubernetes Container Runtime Interface for OCI-based containers
cri-o 1.24 default Kubernetes Container Runtime Interface for OCI-based containers
ghc 8.10 all, default [d], minimal, small Haskell GHC 8.10
ghc 9.2 all, default, minimal, small Haskell GHC 9.2
mariadb 10.5 client, devel, galera, server [d] MariaDB: a very fast and robust SQL database server
mariadb 10.6 client, devel, galera, server MariaDB: a very fast and robust SQL database server
mariadb 10.7 client, devel, galera, server MariaDB: a very fast and robust SQL database server
mariadb 10.8 client, devel, galera, server MariaDB: a very fast and robust SQL database server
mariadb 10.9 client, devel, galera, server MariaDB: a very fast and robust SQL database server
mysql 8.0 client, devel, server [d] MySQL Module
...
To display information about a specific module, provide the name as an argument to the previous command:
$ sudo dnf module list postgresql
Last metadata expiration check: 0:08:48 ago on Thu 19 Jan 2023 02:20:33 PM UTC.
Fedora Modular 37 - x86_64
Name Stream Profiles Summary
postgresql 12 client, server PostgreSQL module
postgresql 13 client, server PostgreSQL module
postgresql 14 client, server PostgreSQL module
postgresql 15 client, server PostgreSQL module
Fedora Modular 37 - x86_64 - Updates
Name Stream Profiles Summary
postgresql 12 client, server PostgreSQL module
postgresql 13 client, server PostgreSQL module
postgresql 14 client, server PostgreSQL module
postgresql 15 client, server PostgreSQL module
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
Install module profiles
The syntax for installing a module is:
dnf [options] module install <module_spec>...
First get a module stream, e.g:
$ dnf module list mariadb
Last metadata expiration check: 0:11:45 ago on Thu 19 Jan 2023 02:20:33 PM UTC.
Fedora Modular 37 - x86_64
Name Stream Profiles Summary
mariadb 10.5 client, devel, galera, server [d] MariaDB: a very fast and robust SQL database server
mariadb 10.6 client, devel, galera, server MariaDB: a very fast and robust SQL database server
mariadb 10.7 client, devel, galera, server MariaDB: a very fast and robust SQL database server
mariadb 10.8 client, devel, galera, server MariaDB: a very fast and robust SQL database server
mariadb 10.9 client, devel, galera, server MariaDB: a very fast and robust SQL database server
You can see that mariadb
has on streams, one for MariaDB 10.8, and another for 10.7. To install MariaDB 10.8:
dnf module install mariadb:10.8/server
Confirm installation by typing y. After installation, you can confirm package version with commandrpm
.
To downgrade to MariaDB 10.7, you’ll install the 10.7 module
dnf module install mariadb:10.7/server
Enable a module stream
If you have a different version that was installed through other external repositories, uninstall it first, then enable module
sudo dnf module enable mariadb:10.9/server
This will enable a module stream and make the stream RPMs available in the package set. Modular dependencies are resolved and checked at the enablement time but do not get enabled automatically. The enable command can also be used for switching module streams
Enable a module stream
To disable a module and make all related module streams unavailable, use:
dnf module disable <module-name>
List enabled module streams
To list module streams that are enabled, execute
dnf module list --enabled
Get module stream detailed information
The syntax for printing a detailed information about given module stream is:
dnf module info <module_spec>
Example:
dnf module info nginx
Reset module state
You can also reset module state so it’s no longer enabled or disabled.
dnf module reset <module_spec>
Example:
dnf module reset mariadb:10.8/server
Leave a Reply
You must be logged in to post a comment.