DNF Modules: a powerful tool for the pro in all of us
So, I have been using Fedora for close to 10 years now, and I have never run into an issue, in any of my web development work, that demanded a slightly newer (or older) version of a particular package. That is…until today. I am currently working on integrating a Moodle e-learning solution here on the site, and instead of rolling my own, I decided to go with Moodle. Personal choices aside, Moodle needs a version of MariaDB that is two minor releases ahead of the one supplied by the default Fedora 38 install. So, what’s the solution you ask? DNF Modules!
If and when this happens to you, here’s a handy little snippet to help you out. The example provided is MariaDB, but this applies across the board. Go ahead! Explore a little.
Installing MariaDB server from the Fedora Modular repository
To list the available versions (streams in modularity terminology) of MariaDB:
dnf module list mariadb
This will output something similar to the following:
Last metadata expiration check: 3:27:14 ago on Tue 25 Jul 2023 06:37:37 PM EDT.
Fedora Modular 38 - 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 [e] client, devel, galera, server [i] MariaDB: a very fast and robust SQL database server
Fedora Modular 38 - x86_64 - Updates
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 [e] client, devel, galera, server [i] MariaDB: a very fast and robust SQL database server
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
To enable the version of MariaDB you want to use and make the stream RPMs available in the package set:
sudo dnf module enable mariadb:10.9
At this point you can verify that the available RPM provides the 10.4 verison of MariaDB server:
dnf list mariadb-server
To install MariaDB server:
sudo dnf module install mariadb/server
With modules, you could also install a specific profile: like client, devel or galera (the multi-master replica). For instance, if you don’t want to install the server stuff, but only the client packages:
sudo dnf module install mariadb:10.4/client
And…that’s it! Just like that, new branches open up to you! You learn something new everyday. Today, I learned this, so I am sharing it with you. Hopefully it helps you out.