YUM依赖项问题,即使安装了库

我们从源代码构build我们自己的php和mysql包,这个包是用于php-5.4.10版本的,并且将它们放在我们自己的仓库中。 我们来调用这个包custom-php和custom-mysql(-libs&-server)

当我做一个yum在服务器上安装custom-php时,yum列出了一个依赖关系问题:

--> Finished Dependency Resolution Error: Package: custom-php-1.1.x86_64 (php) Requires: libmysqlclient.so.18(libmysqlclient_16)(64bit) Error: Package: custom-php-1.1.x86_64 (php) Requires: libmysqlclient.so.18(libmysqlclient_18)(64bit) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest 

libmysqlclient.so.18文件由custom-mysql-libs提供,它在custom-php的spec文件中的Requires下列出。 即使我发行yum install custom-php之前手动安装了custom-mysql-libs,我仍然得到上面的错误。

我们的custom-mysql-libs是从mysql源代码构build的,并提供了libmysqlclient.so:

 $ rpm -qlp custom-mysql-libs-1.0.x86_64.rpm /custom/lib64/libmysqlclient.so /custom/lib64/libmysqlclient.so.18 /custom/lib64/libmysqlclient.so.18.0.0 .... $ 

当我们在不同的地方安装这些库时,custom-mysql-libs会在完成之后发出一个ldconfig文件,该文件在/etc/ld.so.conf.d/文件中指定的path。 我validation了这些库是可见的与ldconfig -v

 # ldconfig -v ... /custom/lib64: libmysqlclient.so.18 -> libmysqlclient.so.18.0.0 ... # 

百胜也find了图书馆和包:

 # yum whatprovides */libmysqlclient.so.18 Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile custom-mysql-libs-1.0.x86_64 : Custom MySQL libraries Repo : custom Matched from: Filename : /custom/lib64/libmysqlclient.so.18 custom-mysql-libs-1.0.x86_64 : Custom MySQL libraries Repo : installed Matched from: Filename : /custom/lib64/libmysqlclient.so.18 

任何帮助表示赞赏。 谢谢 !

rpm对本地文件系统一无所知。 它只在自己的数据库中查看系统上的内容。 在你的情况下,这是一个非标准的地方放图书馆。 一般来说,标准位置在/usr/lib64/mysql/而你的/ custom是自定义的,所以rpm没有find它应该在的地方。

这里有两个选项..

1)通过添加一些符号链接来重build自定义链接,这可能工作(真正未经testing)

2)使用–no-deps标志强制安装,并将mysqllibrary文件从/ custom链接到/ usr / lib64 / mysql /

我不认为我们可以给你任何神奇的命令,让它像你希望的那样工作。

yum和rpm无法跟踪你背后的任何事情。 因此,如果你在标准软件包发行版之外安装的东西,像yum这样漂亮的帮助者没有足够的编程来预测这一点。 你将不得不承担更多的手工处理这样的错误的责任。

一般来说,我所做的就是尽量不要绕开系统,尽量使用包装系统。 就像如果我重build一个包到我的规格,我下载的包的来源,并重新做一个新的包后进行我的修改等。

对于将库安装到非标准位置的第三方RPM,我们也遇到类似的问题。 您可以closuresspec文件中的自动依赖关系处理,然后通过包名称列出您的依赖关系。 例如在你的自定义php规范文件中添加:

 AutoReqProv: no Requires: custom-mysql 

不要忘记添加任何你可能需要的依赖关系。