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
  • 583
  • 2
  • 10
  • 32
Theo
  • 41
  • 2
  • could you post the output of runnig `ldconfig` in verbose mode: `sudo ldconfig -v`? – muru Aug 07 '14 at 08:56
  • @muru The whole output or for some particular part for the directory of interest? It is quite big. – Theo Aug 07 '14 at 09:06
  • you can force ldconfig to only run om one directory using the `-n` flag. Post to http://paste.ubuntu.com if the output still is very large. – muru Aug 07 '14 at 09:08
  • Ok, so here it is: http://paste.ubuntu.com/7979057/ Note the weird 4th line from the end. I did not add this in any way. – Theo Aug 07 '14 at 11:42

0 Answers0