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

Fra*_*ter 5 bash bashrc

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

export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
Run Code Online (Sandbox Code Playgroud)

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

所以我的问题。可能是什么原因.bash_profile,并.bashrc没有负载/执行的出口?

谢谢!!

ps 我通过 ssh 进入机器,除了 CUDA 驱动器和 sdk 之外,它是一个全新的 Ubuntu 10.10 安装。

pps 全新安装一开始就没有.bash_profilenano ~/.bash_profile是空的

gei*_*rha 5

当您在 Ubuntu 中以图形方式登录时,.bash_profile不会被读取,但.profile会(来自 sh)。因此,如果您将这些导出放入 中.profile,然后再次登录,环境变量应该可用。

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