extending default lib search path in ubuntu
Asked Answered
I

2

17

How can i extend default lib search path in ubuntu(in a way that it is also persistent) ? no, I do not want export LD_LIBRARY_PATH based temporary solution, rather some way to extend the default lib search path ?

while google-ing, I cam across some info, that in ubuntu the default search path resides in /etc/ld.so.conf.d , but editing libc.conf does not extended the default path.. so i think either i am doing it wrong, or something is missing...

the edited libc.conf looks like...

# libc default configuration
/usr/local/lib:/path_to_my_libraries/lib
Inexpressive answered 5/2, 2012 at 17:48 Comment(0)
L
33

create (as root) a new file in /etc/ld.so.conf.d/ containing, the new path. For example:

sudo echo "/path-to-your-libs/" >> /etc/ld.so.conf.d/your.conf

after that run

sudo ldconfig

No need to change libc.conf.

Lynnalynne answered 5/2, 2012 at 18:4 Comment(1)
Thanks! Note that just ".conf" file without name before extension doesn't work.Platon
N
3

Using sudo, without becoming root

This will create a your.conf file with a reference to /path-to-your-libs/:

$ echo '/path-to-your-libs/' |sudo tee -a /etc/ld.so.conf.d/your.conf

Do not forget to finish off with a dynamic link library cache refresh:

$ sudo ldconfig
Nightly answered 18/11, 2017 at 9:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.