How to set the environmental variable LD_LIBRARY_PATH in linux

后端 未结 10 1670
独厮守ぢ
独厮守ぢ 2020-11-22 11:11

I have first executed the command: export LD_LIBRARY_PATH=/usr/local/lib

Then I have opened .bash_profile file: vi ~/.bash_profile

10条回答
  •  -上瘾入骨i
    2020-11-22 11:33

    You could try adding a custom script, say myenv_vars.sh in /etc/profile.d.

    cd /etc/profile.d
    sudo touch myenv_vars.sh
    sudo gedit myenv_vars.sh
    

    Add this to the empty file, and save it.

    export LD_LIBRARY_PATH=/usr/local/lib
    

    Logout and login, LD_LIBRARY_PATH will have been set permanently.

提交回复
热议问题