How to set the environmental variable LD_LIBRARY_PATH in linux

后端 未结 10 1425
独厮守ぢ
独厮守ぢ 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条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 11:23

    Add

    LD_LIBRARY_PATH="/path/you/want1:/path/you/want/2"

    to /etc/environment

    See the Ubuntu Documentation.

    CORRECTION: I should take my own advice and actually read the documentation. It says that this does not apply to LD_LIBRARY_PATH: Since Ubuntu 9.04 Jaunty Jackalope, LD_LIBRARY_PATH cannot be set in $HOME/.profile, /etc/profile, nor /etc/environment files. You must use /etc/ld.so.conf.d/.conf configuration files.* So user1824407's answer is spot on.

提交回复
热议问题