Installation of gearmand fails on libevent dependency

PeeHaa asked:

I’ve installed the PostgreSQL yum repo and have PostgreSQL running for some time now, but now when I try to install gearmand I get the following errors:

Transaction Check Error:
  file /usr/bin/event_rpcgen.py from install of compat-libevent14-1.4.13-1.rhel6.x86_64 conflicts with file from package libevent-devel-2.0.12-1.rhel6.x86_64
  file /usr/lib64/libevent_core.a from install of compat-libevent14-1.4.13-1.rhel6.x86_64 conflicts with file from package libevent-devel-2.0.12-1.rhel6.x86_64
  file /usr/lib64/libevent_core.so from install of compat-libevent14-1.4.13-1.rhel6.x86_64 conflicts with file from package libevent-devel-2.0.12-1.rhel6.x86_64
  file /usr/lib64/libevent_extra.a from install of compat-libevent14-1.4.13-1.rhel6.x86_64 conflicts with file from package libevent-devel-2.0.12-1.rhel6.x86_64
  file /usr/lib64/libevent_extra.so from install of compat-libevent14-1.4.13-1.rhel6.x86_64 conflicts with file from package libevent-devel-2.0.12-1.rhel6.x86_64

This is because the libevent is coming from the postgresql repository, so I thought I just disable the postgresql repository and try again:

yum --disablerepo=pgdg91 install gearmand

Error: Package: gearmand-0.14-3.el6.2.x86_64 (epel)
       Requires: libevent-1.4.so.2()(64bit)
       Available: libevent-1.4.13-1.el6.x86_64 (base)
           libevent-1.4.so.2()(64bit)
       Installed: libevent-2.0.12-1.rhel6.x86_64 (@pgdg91)
           Not found

Is there a way to keep the libevent version used by postgresql and at the same time install gearmand (with the correct libevent version)? Or am I overlooking something and is there another (perhaps better) way?

My answer:


By using the postgresql yum repository you have broken binary compatibility on your CentOS/RHEL system. This means that there are packages (such as libevent) that that repository upgrades/replaces which are incompatible with other packages provided by CentOS/RHEL once installed.

Specifically, your postgresql repo has replaced libevent-1.4 which ships with RHEL with libevent-2.0 which postgresql provided, and the 1.4 compatibility library which postgresql also provided is broken.

This specific package, gearmand, comes from the epel repository, and so you can try rebuilding it from its source RPM using a command such as:

yumdownloader --source gearmand
rpmbuild --rebuild gearmand-0.14-3.el6.2.src.rpm

Then install the resulting RPM.

Keep in mind that this may require more extensive work to massage the source RPM to accept the new versions of libraries or may cause other issues down the road, but it’s a starting point. In case this fails, you can manually build a source package, but then it becomes difficult to uninstall or upgrade it later, so build a source RPM if you can.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.