From SpectLog
Jump to: navigation, search

Problem

Occasionally after installation of new software on Linux (especially if the software was shipped outside of RPM or other distribution-specific package), it may refuse to start due to inaccessible shared-library.

For example,

/oracle/app/oracle/product/11.2.0/client_1/bin/proc: error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory

Solution

The ad hoc approach is to add the path with the required libraries to LD_LIBRARY_PATH environment variable (which is just like PATH).

For the system-wide applications, it is more convenient to follow standard OS configuration for consistency. On RHEL and similar OSes, add configuration file (*.conf) with the required path to /etc/ld.so.conf.d/ directory. For example, add /etc/ld.so.conf.d/oracle.client.libs.conf file containing the following:

# Path to shared libraries provided by Oracle
/oracle/app/oracle/product/11.2.0/client_1/lib

Run ldconfig to re-read the configuration:

ldconfig

In order to examine existing paths in the library search list and verify that the required library is seen by the system use -v switch:

ldconfig -v