如何在Debian中更改$ PATH变量?我试着改变 /etc/profile
但这只影响了普通用户(是的,我添加了BOTH用户和root路径的路径)。
之后我尝试编辑 /root/.profile
接着 /root/.bashrc
还......
都没有奏效。你知道哪里可能有问题吗?
如何在Debian中更改$ PATH变量?我试着改变 /etc/profile
但这只影响了普通用户(是的,我添加了BOTH用户和root路径的路径)。
之后我尝试编辑 /root/.profile
接着 /root/.bashrc
还......
都没有奏效。你知道哪里可能有问题吗?
这是在debian 6.0上的/etc/login.defs中设置的。
这些是您必须编辑的行:
# *REQUIRED* The default PATH settings, for superuser and normal users.
#
# (they are minimal, add the rest in the shell startup files)
ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
编辑:
我忘了把它放在我找到解决方案的地方: https://serverfault.com/questions/166383/how-set-path-for-all-users-in-debian
修改 /etc/environment
包括这样的一行:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
编辑你的 /etc/.profile
包括 set -vx
靠近顶部。从新窗口重新启动。那么你可以看到'。'处理文件和重置PATH的位置。
另外,确认你真的在你认为的shell中。完成所有启动脚本后,执行 echo $SHELL
并确认值=您期望的shell,最有可能 bash
。
我希望这有帮助。