4

I am playing with Ubuntu libraries. I am trying to add some libraries to /usr/lib/<subdir>/ and to create some proxies for the libraries in /usr/lib/<subdir>/.
Note that /usr/lib/<subdir>/ exists in one of the files in /etc/ld.so.cond.d/.
Unfortunately, ldconf behaviour seems to be very weird and non-trivial for me. And that's why:

When I add some library to /usr/lib/<subdir>/ it is not detected until I add a symbolic link to it from /usr/lib. Why?

I found out that often libraries are placed in /usr/lib/<subdir>/ in a form of triplets:

  • /usr/lib/<subdir>/lib<libname>.so - symbolic link to lib<libname>.so.1
  • /usr/lib/<subdir>/lib<libname>.so.1 - symbolic link to lib<libname>.so.<version>
  • /usr/lib/<subdir>/lib<libname>.so.<version> - the actual library

Ok. To create a proxy I decided to remove symbolic links and to add my own, say:

  • /usr/lib/<subdir>/lib<libname>abc.so - symbolic link to lib<libname>abc.so.1
  • /usr/lib/<subdir>/lib<libname>abc.so.1 - symbolic link to lib<libname>.so.<version>

And then suddenly when I run sudo ldconfig to update this stuff it creates /usr/lib/<subdir>/lib<libname>.so.1 which points to /usr/lib/<subdir>/lib<libname>abc.so.1.. Why?

I can't get the logic at all.

Silicomancer
  • 613
  • 2
  • 12
  • 34
Theo
  • 41
  • 2

0 Answers0