When installing a rpm package it warns that there is a necessary dependent library missing. In fact I have already installed that library from source, so I guess rpm just doesn't know about that.

Then can I let rpm know the existing library, and how? Maybe add some code in a rpm configure file?

By the way, installing the missing library (again) by rpm may solve the problem (quickly), but sometime there's no rpm version available.

2 Answers 2


The RPM dependency database cannot tell that you installed a package from source. The RPM database only knows about the metadata present in the RPM packages, a package installed from source does not contains this metadata.

Some configure scripts that build a package from source will produce pkg-config, which is metadata about the installed package. Yet, there is no clear-cut integration between the metadata from pkg-config and RPM metadata (or DEB metadata, or pacman metadata). When packaging a distro, the packagers insert the metadata in a specific format into the packages (e.g. RPM packages) and that metadata is the one used to determine dependencies. Not metadata provided in any other form.

On the other hand, you can have different versions of a library on the same system. By default (i.e. according to the GNU coding standards which most packages follow) a configure script should install its produce into /usr/local. Whilst packages packaged by the distro (e.g. RPM) should install their content into /usr.

Therefore, if you follow the convention (called FHS) and keep packages/libraries installed from source in /usr/local, then installing the same library through RPM will not conflict with your library (since the packagers of the distro do follow FHS).

When there is no RPM available, you can build it yourself. For that you need to build the package/library from source and install it into a dummy place (a build root). Then provide the metadata needed for the RPM package and package it into an RPM file. TLDP has a dated but very thorough guide on building RPMs.

  • Such a nice answer! with other nice information. Thank you! So build a RPM by myself seems to be the only way when the RPM package is not available.
    – shintaroid
    Aug 1, 2016 at 8:55
  • 1
    In this day and age I would advise against managing code outside of package management if at all possible. Yes you can install the rpm ignoring the dependencies, or even edit the dependencies in an existing rpm, but keeping your system up to date with patches is your first line of defence - your package management system does all the hard work for you until you start going around it.
    – symcbean
    Aug 1, 2016 at 22:43
  • 1
    @shintaroid - I'd argue that, if you need a library for development purposes you should compile from source and keep in /usr/local. Only if you need to meddle with the dependency database of RPMs and to install applications not developed by you, you may want to build an RPM by hand. On the other hand, there are several repos with RPMs compiled by other people where you may find what you are looking for: rpmfusion, atprms (but in question of system stability your mileage may vary with those).
    – grochmal
    Aug 2, 2016 at 1:24

That's a good reason to stick to package managers such as yum, or in the worst case to rpm but avoid installing from source.

The solution would therefore to install that missing dependency with a RPM package. It would be a good idea to remove the one you installed from source first, but that can sometimes be a tad difficult.

  • Thanks for your answer. I hope I can install from RPM or yum, that's much easier. However, sometime (very rare?) the package is just not available.
    – shintaroid
    Aug 1, 2016 at 8:58
  • You should normally find them in custom repositories. Aug 1, 2016 at 9:00
  • Ok, I will always try finding a RPM package (or yum) before try to install from source, and that's much easer indeed. Thank you.
    – shintaroid
    Aug 1, 2016 at 9:17

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.