如何在 MX Linux 中附加到系统范围的“$PATH”?

如何在 MX Linux 中附加到系统范围的“$PATH”?

我想附加到系统范围的$PATH.如何在 MX Linux (MX-22.2.1_x64 ahs) 中执行此操作?

完全清楚:

  1. 我想附加到现有的$PATH,而不是设置一个全新的。 (所以编辑/etc/environment是不可能的。)
  2. 我想修改系统范围的$PATH,而不是特定于 shell 的$PATH(例如.bashrc.bash_profile等)或特定于用户的$PATH.

这可能吗?

我发现/etc/environment.d,这似乎非常适合我的需求,但默认情况下它似乎被忽略。有办法启用它吗?


编辑:这是输出grep -iR "pam_env" /etc/pam.d

/etc/pam.d/su:# file /etc/security/pam_env.conf.
/etc/pam.d/su:session       required   pam_env.so readenv=1
/etc/pam.d/su:session       required   pam_env.so readenv=1 envfile=/etc/default/locale
/etc/pam.d/login:# file /etc/security/pam_env.conf.
/etc/pam.d/login:session       required   pam_env.so readenv=1
/etc/pam.d/login:session       required   pam_env.so readenv=1 envfile=/etc/default/locale
/etc/pam.d/cron:# Read environment variables from pam_env's default files, /etc/environment
/etc/pam.d/cron:# and /etc/security/pam_env.conf.
/etc/pam.d/cron:session       required   pam_env.so
/etc/pam.d/cron:session       required   pam_env.so envfile=/etc/default/locale
/etc/pam.d/lightdm:# Load environment from /etc/environment and ~/.pam_environment
/etc/pam.d/lightdm:session      required pam_env.so readenv=1
/etc/pam.d/lightdm:session      required pam_env.so readenv=1 envfile=/etc/default/locale
/etc/pam.d/polkit-1:session       required   pam_env.so readenv=1 user_readenv=0
/etc/pam.d/polkit-1:session       required   pam_env.so readenv=1 envfile=/etc/default/locale user_readenv=0
/etc/pam.d/lightdm-autologin:# Load environment from /etc/environment and ~/.pam_environment
/etc/pam.d/lightdm-autologin:session      required pam_env.so readenv=1
/etc/pam.d/lightdm-autologin:session      required pam_env.so readenv=1 envfile=/etc/default/locale
/etc/pam.d/lightdm-greeter:# Load environment from /etc/environment and ~/.pam_environment
/etc/pam.d/lightdm-greeter:session      required pam_env.so readenv=1
/etc/pam.d/lightdm-greeter:session      required pam_env.so readenv=1 envfile=/etc/default/locale

相关内容