[SOLVED] why do libraries have varied named symlinks?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
I'm willing to take an educated guess here:
Some applications are linked to the generic library name such as libncurses.so. I'd guess these are written using functions which are known to, or expected to, exist in all versions of the library the author expects to be in existence.
Some applications though might be written to use a specific function which appeared in, for example, libncurses.so.5 -- so they specify that version. obviously, though, this is a problem when the version is updated so simlinks are used until the relevant packages are likely to have been updated.
Sorry, I'm sure somebody who knows the exact process will be along soon, I just wanted to prove my ignorance.
Linux allows an application to either be "very specific" as to what library-version it wants, or very general. Let's say for the sake of example that you have versions 5.1, 5.7, and 4.9 of libcurses on your system, all at the same time. First of all, Linux is capable of handling that, "with grace and style." If an application simply asks for "libcurses," one of those symlinks will define what it will get. If it wants "libcurses 5" or "libcurses 4," ditto. And so on. The very-simple mechanism of symlinks provides the flexibility, and the loader cache (ldconfig) provides the speed.
why is it that multiple symlinks exist for the same library with an apparently ascending version number ?
regards
libfoo.so used by ld during program build
libfoo.so.X used by ld-linux when shared library is loaded
libfoo.so.X.Y - don't know. May be to show user exactly what version is used
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.