什么原因可能是`.bash_profile`和`.bashrc`不执行导出?

CUDA安装教程告诉我将以下两行添加到我的.bash_profile

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

但它不起作用(TM)。 即使我将这些行添加到.bash_profile.bashrc ,我仍然需要手动输入导出,以便找到路径。

所以我的问题。 什么可能是.bash_profile.bashrc不加载/执行导出的原因?

谢谢!!

ps我进入机器,除了CUDA驱动器和sdk之外,还有一个新的Ubuntu 10.10安装。

pps全新安装首先没有.bash_profilenano ~/.bash_profile是空的

当您在Ubuntu中以图形方式登录时,将无法读取.bash_profile ,但.profile将(由sh提供)。 因此,如果将这些导出放在.profile ,然后再次登录,则环境变量应该可用。

另请参阅http://mywiki.wooledge.org/DotFiles和https://help.ubuntu.com/community/EnvironmentVariables