Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to setup LD_LIBRARY_PATH  in Linux?

Posted on 2014-04-03
4
Medium Priority
?
455 Views
Last Modified: 2014-04-21
I am new to Linux environment. I coped oracle client library under /home/test/instantclient. Now I am wondering how can set up the environment variable in Linux.

Thanks for your help
0
Comment
Question by:LolaPet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39976184
To set it for a specific user add this line:

export LD_LIBRARY_PATH=/home/test/instantclient:$LD_LIBRARY_PATH

to the end of the file ".bashrc" in the home directory of the concerned user (Note the leading dot ".").

To get a system wide setting add the above to the end of /etc/bashrc (Note: "bashrc" without the leading dot).
0
 
LVL 13

Accepted Solution

by:
duncanb7 earned 2000 total points
ID: 39976193
Did you try one of these  as follow ?

 1-
modify the file .bash_profile :
add the below lines to .bash_profile:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/test/instantclient
and then in terminal type:
 #source ~/.bash_profile,

2-  For TCSH: setenv LD_LIBRARY_PATH=/home/test/instantclient

3-  For BASH: export LD_LIBRARY_PATH=/home/test/instantclient

4- With most modern distribution (works on Debian, Ubuntu and openSUSE), the loading of shared library is controlled in configuration files ( namely "/etc/ld.so.conf" and all conf files in "/etc/ld.so.conf.d")

Go in directory " /etc/ld.so.conf.d "
As root (for exemple " sudo nano ", or whatever) add a file named " cuda.conf "
Type in the path to the oracle library "/home/test/instantclient", and save the file
As root run " /sbin/ldconfig " to update


And what is your linux distribution you are using , Debain or Centos ?

Duncan
0
 
LVL 23

Expert Comment

by:David
ID: 39977925
@woolmilkproc in (39976184), right idea, but your example seems off -- you expand the variable as if it were previously defined; and omit the library subdirectory.  To clarify:

...
export myhome = '/home/test/instantclient'
export LD_LIBRARY_PATH = $myhome/lib

Or if the variable was in use, the path could be extended to:
export LD_LIBRARY_PATH = /home/test/instantclient/lib:$LD_LIBRARY_PATH

@lolapet, a reminder to check your syntax with:
> env|sort
and look for the variable values
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39978394
@dvz - how can you know that there is a "lib" subdirectory? The asker didn't mention it.

My example works regardless of whether LD_LIBRARY_PATH was already definded or not.

Finally, don't use spaces around "=" when assigning variables.
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question