我们从源代码构建我们自己的 php 和 mysql 包,这个包用于 php-5.4.10 版本,并将它们托管在我们自己的存储库中。我们称这个包为 custom-php 和 custom-mysql(-libs & -server)
当我在服务器上执行 yum install 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
Run Code Online (Sandbox Code Playgroud)
文件 libmysqlclient.so.18 由 custom-mysql-libs 提供,它列在 custom-php 的规范文件中的 Requires 下。即使我在发出 yum install custom-php 之前手动安装 custom-mysql-libs,我仍然会收到上述错误。
我们的 custom-mysql-libs 是从 mysql 源代码构建的,并提供 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
....
$
Run Code Online (Sandbox Code Playgroud)
当我们在不同的地方安装库时,custom-mysql-libs 会在完成后发出一个 ldconfig,其路径在 /etc/ld.so.conf.d/ 下的文件中指定。我用 ldconfig -v 验证了这些库是可见的
# ldconfig -v
...
/custom/lib64:
libmysqlclient.so.18 -> libmysqlclient.so.18.0.0
...
#
Run Code Online (Sandbox Code Playgroud)
Yum 也找到了库和包:
# 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
Run Code Online (Sandbox Code Playgroud)
任何帮助表示赞赏。谢谢 !
rpm 对本地文件系统一无所知。它只在自己的数据库中查找系统上的内容。就您而言,这是放置库的非标准位置。一般来说,标准位置在/usr/lib64/mysql//custom 中,所以 rpm 找不到它应该在的位置。
这里有两个选择..
1)通过添加一些符号链接来重建自定义的,这可能会起作用(确实未经测试)
2) 使用 --no-deps 标志强制安装并将 mysqllibrary 文件从 /custom 符号链接到 /usr/lib64/mysql/
我不认为我们可以给你任何神奇的命令来让它按照你希望的方式工作。