Setting environment variables in linux

0 votes

I am trying to set a path for LD_LIBRARY_PATH.

I tried to execute:

export LD_LIBRARY_PATH=/usr/local/lib

Then I opened the bash_profile file:

vi ~/.bash_profile

and added:

LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH

Now if I restart the terminal, typing echo $LD_LIBRARY_PATH displays no result.

How do I set this path permanently?

May 13 in Linux Administration by Atul
• 5,490 points
11 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

You need to add more information about your distribution. So for ubuntu you'll have to add a custom .conf file to /etc/ld/so/conf/d:

sudo gedit /etc/ld.so.conf.d/randomLibs.conf

Now in this file write the complete path to the directory containing the libraries that you want to add.

/home/linux/myLocalLibs

Just remember to add the path to the directory and not the file itself. All the files inside the directory will automatically be indexed.

Once done, just run:

sudo ldconfig

This will update the system with new libraries.

answered May 13 by ajs3033
• 7,080 points

Related Questions In Linux Administration

0 votes
1 answer

Setting JAVA_HOME in linux

find /usr/lib/jvm/java-1.x.x-openjdk vim /etc/profile Prepend sudo if logged in ...READ MORE

answered May 24 in Linux Administration by DareDev
• 6,670 points
16 views
0 votes
1 answer

How to get octal file permission in linux?

You can use this: stat -c "%a %n" ...READ MORE

answered Jan 3 in Linux Administration by Omkar
• 66,880 points
59 views
0 votes
1 answer

How to create a symlink in Linux?

To create a symbolic link, you can ...READ MORE

answered Jan 31 in Linux Administration by Omkar
• 66,880 points
44 views
0 votes
1 answer

Finding pat of afile in linux

You can use readlink command: readlink -f filename.txt for ...READ MORE

answered Mar 15 in Linux Administration by DareDev
• 6,670 points
11 views
0 votes
1 answer
0 votes
1 answer

How do I set variable if a specific package version is installed in CFEngine?

Here is what you can do.Just use packagesmatching to ...READ MORE

answered Jul 12, 2018 in Other DevOps Questions by Atul
• 10,220 points
58 views
0 votes
1 answer

Install postgreSQL on Ubuntu

Installing PostgreSQL on Ubuntu is very simple, ...READ MORE

answered Mar 22 in Database by Nitesh
26 views
0 votes
1 answer

Access progrs prompt without switching accounts

Use the following to get the postgres prompt ...READ MORE

answered Mar 22 in Database by Mahi
17 views
0 votes
1 answer

How t find httpd.conf file in apache?

First f all, get apache's path: $ ps ...READ MORE

answered Feb 27 in Linux Administration by ajs3033
• 7,080 points
19 views
0 votes
1 answer

How to collect all output in one file?

You can use 2> to redirect it: foo ...READ MORE

answered Mar 1 in Linux Administration by ajs3033
• 7,080 points
17 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.