[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.
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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:
# Added by Peter on 10/01/11 to make the firefox extension for kde-wallet work.
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-22.214.171.124 " 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.