In general, what I do to get the result:
I drive a team:
export LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib
Checking:
echo $LD_LIBRARY_PATH
Result: /u01/app/oracle/product/11.2.0/xe/lib
When I restart or open the new terminal my LD_LIBRARY_PATH
is disabled.
How to fix it?
Advertisement
Answer
Environment variables are available only in the shell where you have created them. If you want to set an environment variable permanently then you can do it either by adding it to the .bashrc file in your home directory. Or by adding it to the /etc/environment file. In case of .bashrc it will be available only for your user, and it will be available only for newly opened shells. In case of /etc/environment it will be available for all newly logged-in users (logout/login needed) and you must have root privileges to do it. Do not write export into these files, just add LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib
at the end of them.