linuxfilesystemsshared-objects

Can I infer a library's version by its filename?


I am trying to correlate between libraries in my filesystem to their versions, in order to see whether or not they are outdated and need to be updated.
My question is, how should I treat "versions" in files' filename and how reliable is this version?
For example

/usr/lib/libz.so.1.2.3
/usr/lib/liblzma.so.5.2.1

Are 1.2.3 and 5.2.1 really the versions of libz and liblzma respectively?

Also, in the following example there are a few libraries that all share the same version, it does not seem logical to me that these few libraries synchronize themselves when there is a new update in version:

/lib/libdl-2.15.so
/lib/libnsl-2.15.so
/lib/libcrypt-2.15.so   
/lib/libnss_dns-2.15.so
/lib/libm-2.15.so
/lib/libc-2.15.so

Solution

  • In short, no.

    The library name is not enforced to a standard, if you keep looking you will see some libraries have no numbers at all, and most don't represent the lowest level version numbers.

    I think a yum or rpm command would not only provide more information, but may also already provide the functionality that you are looking for.

    For instance, list installed packages on CentOS:

    >> rpm -qa
    >> yum list installed
    

    Listing packages to be updated:

    https://www.cyberciti.biz/faq/rhel-centos-fedora-suse-list-package-update/