We build our own php and mysql packages from source, this one is for the php-5.4.10 release, and host these at our own repository. Let's call this package custom-php and custom-mysql(-libs & -server)

When I do a yum install custom-php on a server, yum lists a dependency problem:

--> 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

The file libmysqlclient.so.18 is provided by custom-mysql-libs which is listed under Requires in the spec file of custom-php. Even if I install custom-mysql-libs manually before issuing the yum install custom-php I still get the error above.

Our custom-mysql-libs is built from the mysql source code and provides the libmysqlclient.so:

$ rpm -qlp custom-mysql-libs-1.0.x86_64.rpm 

As we install the libraries at a different place the custom-mysql-libs issues a ldconfig with the path specified in a file under /etc/ld.so.conf.d/ after completion. I verified that the libraries are visible with a ldconfig -v

# ldconfig -v
        libmysqlclient.so.18 -> libmysqlclient.so.18.0.0

Yum does also find the library and package:

# 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

Any help is appreciated. Thanks !


rpm does not know anything about local filesystems. It only looks in it's own database for what is on the system. In your case that is a non-standard place to put the library. Generally the standard place is in /usr/lib64/mysql/ and yours is in /custom so rpm is not finding it where it should be.

Here are two options..

1) rebuild the custom one by adding some symlinks and that might work (really un-tested)

2) Force the install with the --no-deps flag and symlink the mysqllibrary files from /custom to /usr/lib64/mysql/

I don't think there is any magic command that we can give you to make it work as you are hoping.

  • Hi @Mike, Thanks for your reply, the funny thing is that during testing I manually copied the libmysqlclient.so* libraries from /custom/lib64 to /usr/lib64/mysql yet the same error remains Happy holidays! – Scott Dec 26 '12 at 5:43
  • Like I said.. rpm does not care about filesystem.. only what is in it's own database. So you coping it did not put it into the RPM db. – Mike Dec 26 '12 at 14:57

yum and rpm are unable to track anything you do behind its back. Thus, if you install things outside the standard package distributions, these nifty neat helpers like yum don't have enough programming to anticipate this. You'll have to take much more responsibility for manually handling errors like this.

Generally, what I do is to try not to bypass the systems and use the packaging system as much as possible. Like if I rebuild a package to my specs, I download the source of the package and remake a new package after making my modifications and such.


We have a similar problem with third party RPMs that install libraries to non-standard locations. You can turn off automatic dependency processing in your spec file and then list your dependencies by package name. For instance in your custom-php spec file add:

AutoReqProv: no
Requires: custom-mysql

Don't forget to add any other dependencies you may need as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.