Home

LDLIBRARYPATH

LDLIBRARYPATH is not a standard, widely recognized environment variable in Unix-like systems. The correct and commonly used variable for controlling runtime shared library search paths is LD_LIBRARY_PATH. LDLIBRARYPATH may appear as a typo or as a user-defined alias in some scripts, but it is not interpreted by the dynamic linker in any standard way unless explicitly implemented in a shell or program.

LD_LIBRARY_PATH specifies a colon-separated list of directories that the dynamic linker should search for shared libraries

In practice, setting this variable affects how executables locate their dependencies and can influence which library

Best practices encourage installing libraries in standard locations or using binary-specific rpath/runpath settings, or configuring the

at
program
startup
and
for
dynamically
loaded
libraries
(via
dlopen).
Directories
listed
there
are
consulted
before
the
system’s
default
locations,
such
as
/lib
and
/usr/lib,
allowing
users
to
override
or
test
libraries
in
nonstandard
locations.
For
example,
export
LD_LIBRARY_PATH=/custom/lib:/opt/mylibs
would
cause
the
linker
to
look
in
those
directories
first.
versions
are
loaded.
The
exact
search
order
and
interaction
with
embedded
runpath
or
rpath
values
in
binaries
depend
on
the
linker
and
the
operating
system.
While
LD_LIBRARY_PATH
can
be
useful
for
testing
or
development,
it
can
introduce
portability
and
security
risks,
and
it
may
bypass
system-wide
library
management
provided
by
tools
like
ldconfig.
system’s
dynamic
linker
configuration,
rather
than
relying
on
LD_LIBRARY_PATH.
If
LDLIBRARYPATH
appears
in
scripts,
treat
it
as
likely
a
typo
or
a
nonstandard
alias
for
LD_LIBRARY_PATH.
On
other
systems,
such
as
macOS,
analogous
variables
include
DYLD_LIBRARY_PATH,
which
follows
different
rules.