[SOLVED] LD_LIBRARY_PATH added to .bashrc but only works if apps launched from terminal
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
LD_LIBRARY_PATH added to .bashrc but only works if apps launched from terminal
The Firefox extension for integration with kwallet requires me to add the following to my path variables:
Code:
# Added by Peter on 10/01/11 to make the firefox extension for kde-wallet work.
LD_LIBRARY_PATH=/usr/lib/kde4/libkdeinit:/usr/lib/xulrunner-1.9.2.23
export LD_LIBRARY_PATH
I have therefore added the above code to my .bashrc file, which solves the problem when Firefox is launched from the command line, however, this is not ideal because if I launch a website from a link in an external application, then kwallet won't work with it.
I'm not completely sure but I think you better export the variable in your ~/.profile file. Then it should be read at login time.
Thanks for that Ray, but unfortunately that doesn't seem to have worked. I logged off and back on and then launched Firefox normally, but it didn't start the kde-wallet extension (I'm sure there's a command I can use to see what my paths are, but I don't know it).
Disclaimer: this is more of a cludge and not a neat solution.
1. Rename the firefox binary to firefox_original
2. Create a small shell script which sets the variable and then launches firefox_original
3. Save the script as "firefox" in one of the locations in your PATH.
Check which bash startup scripts you have. There are others such as .bash_login and .bash_profile. The bash info manual indicates which one comes first. ( Actually it is common for distro's to source .bashrc then running .profile )
Also, you need to log out and in again after editing .profile ( or .bash_login or .bash_profile ). It is sourced when you log in. Editing the file, and even sourcing it won't help, because you are in the environment of a subshell of your login shell. If your .profile script sources .bashrc, maybe it would have worked if you logged out.
---
You could also add the assignment to the command.
Look at the properties for the Firefox icon. In the Application entry, add: "LD_LIBRARY_PATH=/usr/lib/kde4/libkdeinit:/usr/lib/xulrunner-1.9.2.23 " before "firefox %u".
You can do the same thing in the menu editor, and entry on the panel.
I'm using KDE, and assume you can do the same in gnome.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.