From a separate question, and other articles on the subject, it appears that additional library paths defined by ld.so.conf.d will always be resolved (i.e. in the case of a name clash, such as when overriding a system library), before any libraries supplied via /lib or /usr/lib.

Is it possible to, via ld.so.conf.d or some other mechanism, to create a system-wide path where libraries can be resolved, but at the lowest/latest possible resolution level? For example, I'd like libraries in /ParanoidAndroid/ to be resolved, but I'd like that path to be the last place searched for them (i.e. prioritize the libraries in /lib and /usr/lib over the libraries stored in /ParanoidAndroid/), so the lookup order is now:

  1. Directories from LD_LIBRARY_PATH;
  2. Directories from /etc/ld.so.conf;
  3. /lib;
  4. /usr/lib.
  5. /ParanoidAndroid;

1 Answer 1


You can list /lib and /usr/lib explicitly in /etc/ld.so.conf or one of the files in /etc/ld.so.conf.d, that way directories coming after those two will have lower priority in the search.

Something like this:

# contents of /etc/ld.so.conf

Don't forget to:

$ sudo ldconfig

And you can check that with:

$ ldconfig -v

Then confirm the libraries under /ParanoidAndroid come last.

(You might see warnings such as ldconfig: Path '/lib' given more than once, but that's probably what you expected anyways, right?)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .