Updating PATH environment variable permanently in Docker container

前端 未结 4 1639
北荒
北荒 2020-12-12 23:41

I tried adding to the PATH in the files ~/.profile and /etc/profile as follow.

PATH = $PATH:/required/path
         


        
4条回答
  •  南笙
    南笙 (楼主)
    2020-12-13 00:07

    I got the answer for this question in irc chat. Given here for the benefit of anyone who may come across this. Many people have given wrong answers as update the ~/.profile but that did not work. So use the answer below.

    Update the file ~/.bashrc for user or update the file /etc/enviroment global for global change which will apply for all users.

    In .bashrc export PATH: export PATH=$PATH:/new/path/bin

    In enviroment: PATH=$PATH:/new/path/bin

提交回复
热议问题