CentOS 7编译程序后的环境变量设置
生活随笔
收集整理的這篇文章主要介紹了
CentOS 7编译程序后的环境变量设置
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
今晚在 CentOS 7 上配置 Gitea,配置完成后在本地 clone 倉庫會提示 Failed to execute git command: exec: "git-upload-pack": executable file not found in $PATH,果斷用軟連接打法解決。隨后在 push 時又出現 Failed to execute git command: exec: "git-receive-pack": executable file not found in $PATH。WTF,如果有幾百個需要添加到 $PATH 里的程序,我不可能一一用軟連接添加。而且用 export 方法不能永久解決,直接寫到 bashrc 里又好像有點 low。后使用 Google 大法,學到新技能:
echo 'export PATH=$PATH:/usr/local/git/bin' > /etc/profile.d/git.sh source /etc/bashrc完美解決!既能永久生效,又不污染 bashrc。如果哪天不需要了,只需要刪除 /etc/profile.d/git.sh,然后 source /etc/bashrc。
總結
以上是生活随笔為你收集整理的CentOS 7编译程序后的环境变量设置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Idea项目中常见错误及笔记(Old)
- 下一篇: iOS VIPER架构(三)