0 notes &
Setting your $PATH on Ubuntu (everywhere!)
Really for my own future reference, here is a quick summary of how to set the $PATH variable everywhere on the system (for Ubuntu).
As an example, let’s say you have ruby installed in /usr/bin and REE installed in /opt/ruby-enterprise/bin and you’d like to use REE system-wide.
- Your account: Add this line to your ~/.profile or ~/.bashrc file:
export PATH=/opt/ruby-enterprise/bin:$PATH;
- Sudo access: Ubuntu is, ummmm, unique, in that sudo does not inherit the path of the current user “for security reasons.” However, this really isn’t that much more secure, and furthermore is particularly obnoxious. To revert this behavior, add the following to your ~/.profile or ~/.bashrc file:
alias sudo='sudo env PATH=$PATH'
- System wide: For everyone else and other applications, adjust the PATH line in /etc/environment so it is prefixed with ‘/opt/ruby-enterprise/bin:’