There’s evil in the air and there’s thunder in sky

Meatloaf “Bat out of hell”

$ yum install foo
[..]
Error: foo conflicts with bar

Again I have had the dubious pleasure of having dependencies between RPM-packages ending my attempt to install a single package because of a deep-rooted fear of removing core packages from production systems.

I think this most often happen with MySQL or Percona packages, but I am sure MariaDB and a few other will be able to get you into the same situation too. It’s not the first time I have been here.. (If I am not mistaken the problem shows up when you have several major versions of a program available, all providing some of the same functionality to other packages, all being mutually exclusive.)

$ yum install Percona-Server-client-57
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile

Resolving Dependencies
--> Running transaction check
---> Package Percona-Server-client-57.x86_64 0:5.7.20-19.1.el7 will be installed
--> Processing Dependency: Percona-Server-shared-57 for package: Percona-Server-client-57-5.7.20-19.1.el7.x86_64
--> Running transaction check
---> Package Percona-Server-shared-57.x86_64 0:5.7.20-19.1.el7 will be installed
--> Processing Dependency: Percona-Server-shared-compat-57 for package: Percona-Server-shared-57-5.7.20-19.1.el7.x86_64
--> Running transaction check
---> Package Percona-Server-shared-compat-57.x86_64 0:5.7.20-19.1.el7 will be installed
--> Processing Conflict: Percona-Server-shared-compat-57-5.7.20-19.1.el7.x86_64 conflicts Percona-Server-shared-56
--> Finished Dependency Resolution

Error: Percona-Server-shared-compat-57 conflicts with Percona-Server-shared-56-5.6.38-rel83.0.el7.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

So if I want to install Percona-Server-client-57 I have to install Percona-Server-shared-compat-57 too, and that I can’t because of the already installed Percona-Server-shared-56. OK, so I will just remove Percona-Server-shared-56 and then install Percona-Server-shared-compat-57 before doing the install I first tried to do:

$ yum remove Percona-Server-shared-56
[..]
Dependencies Resolved

================================================================================================================
 Package                           Arch            Version                      Repository                 Size
================================================================================================================
Removing:
 Percona-Server-shared-56          x86_64          5.6.38-rel83.0.el7           @percona-release          3.4 M

Removing for dependencies:
 MySQL-python                      x86_64          1.2.5-1.el7                  @centos_os                284 k
 fail2ban                          noarch          0.9.7-1.el7                  @epel                     0.0
 fail2ban-sendmail                 noarch          0.9.7-1.el7                  @epel                      11 k
 perl-DBD-MySQL                    x86_64          4.023-5.el7                  @centos_os                323 k
 postfix                           x86_64          2:2.10.1-6.el7               @centos_os                 12 M
 redhat-lsb-core                   x86_64          4.1-27.el7.centos.1          @anaconda                  45 k

Transaction Summary
================================================================================================================
Remove  1 Package (+6 Dependent packages)

Installed size: 16 M
Is this ok [y/N]:

Very much not OK. I can live with temporarily removing MySQL-python, but I’d like to at least keep things with descriptions like this

Description : The Linux Standard Base (LSB) Core module support
: provides the fundamental system interfaces, libraries,
: and runtime environment upon which all conforming
: applications and libraries depend.

The problem seems to be that Postfix needs libmysqlclient.so.18 which is provided by both Percona-Server-shared-56 and Percona-Server-shared-compat-57. So I just need to swap the former for the latter, and then I can run my original install.

OK, so I both want to remove a package and install a package. And I want to do it at the same time, so that I don’t have to remove things like redhat-lsb-core. Did you notice the use of the word transaction in Transaction Summary from yum? A transaction is actually what I want. Luckily yum provides a way of doing this, and have probably done since forever, but I didn’t learn about it till today. And as so many times before, it is a shell that solves our problems:

$ yum shell
Loaded plugins: fastestmirror, priorities
> remove Percona-Server-shared-56
> install Percona-Server-shared-compat-57
Loading mirror speeds from cached hostfile
> run
--> Running transaction check
---> Package Percona-Server-shared-56.x86_64 0:5.6.38-rel83.0.el7 will be erased
---> Package Percona-Server-shared-compat-57.x86_64 0:5.7.20-19.1.el7 will be installed
--> Finished Dependency Resolution

==================================================================================================
 Package                             Arch       Version                Repository            Size
==================================================================================================

Installing:
 Percona-Server-shared-compat-57     x86_64     5.7.20-19.1.el7        percona-release      1.2 M
Removing:
 Percona-Server-shared-56            x86_64     5.6.38-rel83.0.el7     @percona-release     3.4 M

Transaction Summary
==================================================================================================
Install  1 Package
Remove   1 Package

Total download size: 1.2 M
Is this ok [y/d/N]:

Yes, very much thank you! And then finally:

$ yum install Percona-Server-client-57
[..]
Dependencies Resolved

==================================================================================================
 Package                        Arch         Version                  Repository             Size
==================================================================================================
Installing:
 Percona-Server-client-57       x86_64       5.7.20-19.1.el7          percona-release       7.2 M
Installing for dependencies:
 Percona-Server-shared-57       x86_64       5.7.20-19.1.el7          percona-release       747 k

Transaction Summary
==================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 7.9 M
Installed size: 41 M
Is this ok [y/d/N]:y
[..]
Complete!

Done and done :-)

This post first appeared on my private blog - the version here has some minor tweaks

Sigurd Urdahl

Senior Systems Consultant at Redpill Linpro

Sigurd has been working at Redpill Linpro longer than most of us can remember. He has seen countless computer systems stumble into trouble, and this has given him ample opportunity to hone his skills on finding faults and getting things back on track.

Thoughts on the CrowdStrike Outage

Unless you’ve been living under a rock, you probably know that last Friday a global crash of computer systems caused by ‘CrowdStrike’ led to widespread chaos and mayhem: flights were cancelled, shops closed their doors, even some hospitals and pharmacies were affected. When things like this happen, I first have a smug feeling “this would never happen at our place”, then I start thinking. Could it?

Broken Software Updates

Our department do take responsibility for keeping quite a lot ... [continue reading]

Alarms made right

Published on June 27, 2024

Just-Make-toolbox

Published on March 22, 2024