sudo gedit ~/.profile
在该文件最后加上
export PATH=/usr/local/cuda-7.5/bin:$PATH
# ~/.profile: executed by the command interpreter for login shells.# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login# exists.# see /usr/share/doc/bash/examples/startup-files for examples.# the files are located in the bash-doc package.# the default umask is set in /etc/profile; for setting the umask# for ssh logins, install and configure the libpam-umask package.#umask 022# if running bashif [ -n "$BASH_VERSION" ]; then# include .bashrc if it existsif [ -f "$HOME/.bashrc" ]; then. "$HOME/.bashrc"fifi# set PATH so it includes user's private bin if it existsif [ -d "$HOME/bin" ] ; thenPATH="$HOME/bin:$PATH"fiexport PATH=/usr/local/cuda-7.5/bin:$PATH
Note:The code in~/.profileis run after~/.pam_environmenthas been read. That makes~/.profilesuitable to use if you want to override a locale related variable that was set in~/.pam_environmentvia e.g. Language Support.
关于环境变量的详情可以查看:/community/EnvironmentVariables