1

I'm trying to install a MariaDB RPM provided by MariaDB, not Centos. Since DNF natively supports priority, that should be as simple as creating a .repo file similar to:

[MariaDB]
name=The MariaDB 10.4 repository
baseurl=http://yum.mariadb.org/10.4/centos8-amd64
enabled=1
gpgcheck=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
priority=1

However, when I list available packages, I DO get packages from the newly entered MariaDB repo, but the priority=1 seems to be ignored and packages from CentOS AppStream with similar (but different case) names are over-riding it.

sudo yum list |grep -i mariadb-server
MariaDB-server-debuginfo.x86_64                      10.4.12-1.el8                                     MariaDB         
mariadb-server.x86_64                                3:10.3.17-1.module_el8.1.0+257+48736ea6           AppStream       
mariadb-server-galera.x86_64                         3:10.3.17-1.module_el8.1.0+257+48736ea6           AppStream       
mariadb-server-utils.x86_64                          3:10.3.17-1.module_el8.1.0+257+48736ea6           AppStream 

However, if I disable the AppStream repo in my yum command, it works as it should (ignoring the missing dependencies from AppStream):

sudo yum list --disablerepo=AppStream |grep -i mariadb-server
Modular dependency problems:

 Problem 1: conflicting requests
  - nothing provides module(perl:5.26) needed by module perl-DBD-MySQL:4.046:8010020191114030811:073fa5fe-0.x86_64
 Problem 2: conflicting requests
  - nothing provides module(perl:5.26) needed by module perl-DBI:1.641:8010020191113222731:16b3ab4d-0.x86_64
MariaDB-server.x86_64                              10.4.12-1.el8                              MariaDB         
MariaDB-server-debuginfo.x86_64                    10.4.12-1.el8                              MariaDB       

Am I doing something wrong, or is this simply just a bug in DNF, possibly from the different cases used by Centos (mariadb-server) and MariaDB (MariaDB-server).

I can get this to work manually of course, but I want to setup puppet to install it automatically, which I can't seem to get working.

Steve Sether
  • 133
  • 7

1 Answers1

4

Case sensitivity should not matter so much here, because both packages virtually provide mariadb-server capability (same case).

The major reason why DNF wants to install MariaDB from AppStream is that it has a preference for modular packages. Which means, that if specific packages (names) or virtual provides are part of a module, and there are packages with the same names available from other repositories and they are not part of the module, then DNF will always want to install packages from the modular repository.

A useful command here, to find whether a specific package is part of a module is:

sudo dnf module provides mariadb-server

This finds any modules which have mariadb-server package.

In AppStream repo, MariaDB packages are with the mariadb module.

By disabling the AppStream we put a blind fold on DNF so it doesn't see what it likes. But the better way is to teach it to like non-modular packages by adding module_hotfixes=1 to the repository of interest, e.g.:

[MariaDB]
name=The MariaDB 10.4 repository
baseurl=http://yum.mariadb.org/10.4/centos8-amd64
enabled=1
gpgcheck=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
priority=1
module_hotfixes=1

Note that priority config should be retained, because technically 3:10.3.17 (higher Epoch: 3) version still wins over 10.4.12 (Epoch: none, same as 0:10.4.12).

Danila Vershinin
  • 4,738
  • 3
  • 16
  • 21
  • Thanks. This works perfectly. I had a suspicion the problem had something to do with modules, but IIUC modules are new in DNF, so this is the first time I've encountered them. – Steve Sether May 13 '20 at 14:54