Configuring Dynamic Loader
By default, the dynamic loader
(/lib/ld-linux.so.2) searches through /lib and /usr/lib for dynamic libraries that are needed
by programs when you run them. However, if there are libraries in
directories other than /lib and
/usr/lib, you need to add them to
the /etc/ld.so.conf file in order for the dynamic
loader to find them. One directory that is very common to contain
additional libraries is /usr/local/lib so we add that directory to the
dynamic loader's search path.
Create a new file /etc/ld.so.conf by running the
following:
cat > /etc/ld.so.conf << "EOF"
# Begin /etc/ld.so.conf
/usr/local/lib
# End /etc/ld.so.conf
EOF
Although it's not necessary to add the
/lib and
/usr/lib directories it doesn't
hurt. This way it can be seen right away what's being searched and a you
don't have to remember the default search paths if you don't want to.