Visit the LQ Articles and Editorials section
Go Back > Forums > Linux Forums > Linux - Distributions > Suse/Novell
User Name
Suse/Novell This Forum is for the discussion of Suse Linux.


Search this Thread
Old 01-10-2014, 07:22 AM   #1
LQ Newbie
Registered: Dec 2013
Posts: 12

Rep: Reputation: Disabled


Is there any way to set LD_LIBRARY_PATH environment for all users?

I am using
1) Suse Linux 11 Enterprise Server
2) DB2 10.5 Enterprise
3) JDBC drivers

I have setup my environment by using DB2 JDBC by export $CLASSPATH to the right JDBC drivers (db2jcc4.jar) and export LD_LIBRARY_PATH to /home/db2inst1/sqllib/lib. It work fine with the JDBC query which I am able to executed in the same terminal that will connect to DB2 database and return the query result. But when I switch to another users or closed the terminal, the $CLASSPATH and $LD_LIBRARY_PATH has changed. I need to export it again.

Thanks in advance.
Old 01-10-2014, 07:58 AM   #2
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,010

Rep: Reputation: 1347Reputation: 1347Reputation: 1347Reputation: 1347Reputation: 1347Reputation: 1347Reputation: 1347Reputation: 1347Reputation: 1347Reputation: 1347

You can use /etc/profile.local to define the env. variables you need.
For more details see this

1 members found this post helpful.
Old 01-13-2014, 11:25 PM   #3
LQ Newbie
Registered: Dec 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thanks Bathory. It work on my classpath after I exported it in /etc/profile.local but it didnt work on LD_LIBRARY_PATH.

export CLASSPATH=/home/db2inst1/sqllib/java/db2jcc4.jar:${CLASSPATH}
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/db2inst1/sqllib/lib64

I had cognos installed in the same environment, when I switch over to db2 default user db2inst1,I believe it has been overwrite on LD_LIBRARY_PATH. I still trying to figure out any config where they could have set in cognos or somehow link that to db2.

db2inst1@db2v105:/root/Desktop> $LD_LIBRARY_PATH
bash: /opt/ibm/cognos/c10_64/bin64:/opt/ibm/cognos/c10_64/cgi-bin: No such file

Thank you
Old 01-14-2014, 02:24 AM   #4
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,555

Rep: Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466
it is set, as far as I see. You need to check it by:
db2inst1@db2v105:/root/Desktop> $LD_LIBRARY_PATH
bash: /opt/ibm/cognos/c10_64/bin64:/opt/ibm/cognos/c10_64/cgi-bin: No such file
in this example LD_LIBRARY_PATH is set to /opt/ibm/cognos/c10_64/bin64:/opt/ibm/cognos/c10_64/cgi-bin and you tried to execute it (I mean you tried to execute this string as it was a command) and failed. It is the expected behaviour.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
what is the LD_LIBRARY_PATH docetes Programming 2 02-20-2007 03:25 AM
Ld_library_path newbie_adm Linux - Newbie 2 08-30-2006 09:52 AM
???? Ld_library_path ???? g452 Linux - Software 9 08-26-2004 04:00 PM
Ld_library_path barrys Mandriva 2 06-15-2004 01:19 PM
Ld_library_path ? dahmad Linux - Newbie 5 02-22-2003 12:08 AM

All times are GMT -5. The time now is 08:25 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration