Is there a command that could give me a package name and version for a library?

For example, I want to get mariadb-libs version for libmysqlclient_r.so.16 library that is currently not installed, but required.

Updated after answer reading:

yum whatprovides "*libmysqlclient*" shows no libmysqlclient_r.so.16 library listed. Only so.18 libraries are displayed for ol7_latest repository for different versions of mariadb-libs (5.5.56-2.el7.x86_64,5.5.60-1.el7_5.x86_64, 5.5.64-1.el7.x86_64).

OS: Oracle linux 7.7

  • 1
  • 1
    The question linked above is different, but the answer provides the information requested here. Oct 29, 2019 at 16:51
  • I've tried those commands but it prints information about so.18 library. Maybe some repositories or repository archive should be enabled to show in which package could be so.16 library, not so.18.
    – Gryu
    Oct 29, 2019 at 20:10

2 Answers 2


You can use the yum whatprovides:

provides or whatprovides

Is used to find out which package provides some feature or file. Just use a specific name or a file-glob-syntax wildcards to list the packages available or installed that provide that feature or file.


yum whatprovides "*libmysqlclient*"
  • Thank you for answer! But it shows only something like: 1:mariadb-libs-5.5.64-1.el7.x86_64 and then Provides : libmysqlclient.so.18(libmysqlclient_16). If there way to show which packages contain libmysqlclient.so.16? Or is it impossible for system that does not have access to repositories with mariadb-libs that contain libmysqlclient.so.16 version?
    – Gryu
    Oct 29, 2019 at 20:04
  • It almost answers the title's question, so I think I could approve your answer.
    – Gryu
    Oct 29, 2019 at 21:05

I'm sorry. I think, it impossible to get old version of library using only simple shell command. To find it I've used rpmfind.net rpmfind.net with library name search keword inputed

It shows, that this library version available for el6 system, not for el7. Maybe it is possible to get such information in el7 by enabling repositories for el6, but it has no sense. Installation from wrong repositories could break system. And it is more easier to use rpmfind instead of using command that requires additional repositories enabling. So if the library is required it is better to install Oracle Linux 6 for this or other version printed out on rpmfind.

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.