rpm包装:使用rpm安装的文件,但需要该文件的其他rpm找不到

问题描述

问题:我的rpm软件包安装了以下软件包,但在其他软件包将其用作依赖项时却找不到:

sudo rpm -qlp libjaeger-16.0.0-3641.g0b61b1fc.el8.x86_64.rpm

/usr/lib64/libjaegertracing.so.0
/usr/lib64/libjaegertracing.so.0.6.1
/usr/lib64/libopentracing.so.1
/usr/lib64/libopentracing.so.1.6.0
/usr/lib64/libthrift.so.0.13.0

,对于rpm软件包(在 Requires (需要)字段中提到了此软件包),它确实指定了您需要的共享库:

Error: 
 Problem 1: conflicting requests
  - nothing provides libjaegertracing.so.0()(64bit) needed by ceph-common-2:16.0.0-3642.g90dc7b19.el8.x86_64
  - nothing provides libopentracing.so.1()(64bit) needed by ceph-common-2:16.0.0-3642.g90dc7b19.el8.x86_64
  - nothing provides libthrift.so.0.13.0()(64bit) needed by ceph-common-2:16.0.0-3642.g90dc7b19.el8.x86_64

但是,正如您所看到的,即使在了解了必需rpm提供的文件之后,它也无法解析这些文件的位置。

我考虑过的事项和检查:

  1. 正在同一平台(64位)上构建
  2. 实验性地检查了一个虚拟的规格文件>>与rpm --provides 一起使用还可以列出共享库,效果很好
    rpm -q --provides libjaeger2-1-1.x86_64
    libjaeger2 = 1-1
    libjaeger2(x86-64) = 1-1
    libjaegertracing.so.0()(64bit)
    libopentracing.so.1()(64bit)
    libthrift.so.0.13.0()(64bit)

但是当我对创建的主要源rpm执行相同操作时 我看不到提供中的共享库:

❯ sudo rpm -q --provides libjaeger-16.0.0-3641.g0b61b1fc.el8.x86_64.rpm

libjaeger = 2:16.0.0-3641.g0b61b1fc.el8
libjaeger(x86-64) = 2:16.0.0-3641.g0b61b1fc.el8

我如何确保rpm能够解析并找到这些共享库?

规范文件的相关部分:

%if %{with jaeger}
%files -n libjaeger
#will have to change with find_package method
%{_libdir}/libopentracing.so.*
%{_libdir}/libthrift.so.*
%{_libdir}/libjaegertracing.so.*

%post -n libjaeger -p /sbin/ldconfig
%postun -n libjaeger -p /sbin/ldconfig

%files -n libjaeger-devel
%{_includedir}/thrift
%{_includedir}/jaegertracing
%{_includedir}/opentracing
%{_libdir}/libopentracing.so
%{_libdir}/libthrift.so
%{_libdir}/libjaegertracing.so
%endif



 %package -n libjaeger
    Summary:    Ceph distributed file system client library
    %if 0%{?suse_version}
    Group:      System/Libraries
    %endif
    Obsoletes:  libjaeger < %{_epoch_prefix}%{version}-%{release}
    %description -n libjaeger
    Ceph is a distributed network file system designed to provide excellent
    performance,reliability,and scalability.

解决方法

您可能禁用了自动提供。参见:http://ftp.rpm.org/max-rpm/s1-rpm-depend-auto-depend.html

您必须通过使用AutoReqProv删除该行来再次启用它,或在spec中明确写上它:

  Provides: libjaegertracing.so.0()(64bit)
  Provides: libopentracing.so.1()(64bit)

首选第二个,因为第二个很难维护。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...