Debian – How to add a path to system $PATH for all users’s non-login shell for debian

debianenvironment-variablespath

After installing some programs in /opt/xxx/bin, I want to add /opt/xxx/bin to system $PATH for all users's non-login shell. What should I do?

Best Answer

On Debian and other systems that use PAM (which is most of them nowadays), you can set environment variables (including PATH) in /etc/environment. This will work for any login method that uses the pam_env module (either in the auth section or in the session section); on Debian that should be all of them (at least the ones that provide ways to log in and run commands).

Related Question