我已经安装了PostgreSQL yum repo,现在PostgreSQL运行了一段时间,但现在当我尝试安装gearmand我得到以下错误:
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
这是因为libevent来自postgresql存储库,所以我想我只是禁用postgresql存储库,然后再试一次:
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
有没有办法让postgresql使用libevent版本,同时安装gearmand(使用正确的libevent版本)? 或者我忽略了一些东西,还有另外一种(也许更好)的方法吗?
通过使用postgresql yum版本库,你已经破坏了CentOS / RHEL系统的二进制兼容性。 这意味着有一些软件包(比如libevent),这个软件包升级/replace,与CentOS / RHEL提供的其他软件包不兼容。
具体地说,你的postgresql repo用postgresql提供的libevent-2.0代替了RHEL附带的libevent-1.4,并且postgresql提供的1.4兼容性库也被破坏了。
这个特定的软件包,gearmand,来自epel仓库,所以你可以尝试使用如下命令从源RPM重build它:
yumdownloader --source gearmand rpmbuild --rebuild gearmand-0.14-3.el6.2.src.rpm
然后安装生成的RPM。
请记住,这可能需要更广泛的工作来按摩源RPM以接受新版本的库,或者可能会导致其他问题,但这是一个起点。 如果出现这种情况,您可以手动构build一个源代码包,但之后很难将其卸载或升级,所以如果可以的话,build立一个源代码RPM。
我的猜测是,下一步手动编译gearmand会更好:1)编译libevent并将其安装到非标准目录中:
wget --no-check-certificate https://github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz tar xvfz libevent-2.0.19-stable.tar.gz cd libevent-2.0.19-stable ./configure --prefix /opt/libevent && make && make install
2)使用类似下面的方式编译gearmand:
wget https://launchpad.net/gearmand/trunk/0.33/+download/gearmand-0.33.tar.gz tar xvfz gearmand-0.33.tar.gz cd gearmand-0.33 export LDFLAGS='LDFLAGS=-L/opt/libevent' ./configure && make && make install
请让我知道这可不可以帮你。