Ubuntu – What could be a reason for `.bash_profile` and `.bashrc` not to execute the exports

bashbashrc

the CUDA installation tutorial tells me to add the following two lines to my .bash_profile.

export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

But it does not work (TM). Even if I add these lines to .bash_profile and .bashrc, I still have to enter the exports manually, for the paths to be found.

So my question. What could be a reason for .bash_profile and .bashrc not to load/execute the exports?

Thanks!!

p.s. I ssh into the machine and it is, apart from the CUDA drive and sdk, a fresh Ubuntu 10.10 installation.

p.p.s. The fresh installation did not have a .bash_profile in the first place. nano ~/.bash_profile was empty

Best Answer

When you log in graphically in Ubuntu, .bash_profile will not be read, but .profile will (sourced by sh). So if you put those exports in .profile, then log in again, the environment variables should be available.

Also see http://mywiki.wooledge.org/DotFiles and https://help.ubuntu.com/community/EnvironmentVariables