我想将 texlive 的目录添加到我的 PATH,所以我输入export PATH=$PATH:/usr/local/texlive/2018/bin/x86_64-linux
并正确更新 PATH 变量。我可以使用 texlive 路径中列出的命令,并echo $PATH
返回通常的 usr/bin 和 texlive 路径。
但是当我关闭我的终端并再次打开它时,它不再工作,然后echo $PATH
返回/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
(这也有点奇怪......)。
试图编辑.profile
或.bashrc
(我放在export PATH=$PATH:/usr/local/texlive/2018/bin/x86_64-linux
最后),但 bash 似乎没有在新终端上读取它。
添加export PATH="$PATH:<YourPath>"
在末尾,如果有~/.profile
,请不要忘记删除.bash_profile
,因为 bash 不会查看.profile
是否.bash_profile
存在(根据为什么 ~/.bash_profile 在打开终端时没有获取源?)。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句