1. /etc/ld.so.conf
include /etc/ld.so.conf.d/*.conf
此配置文件中包含库的路径, include指定了其它配置文件的路径,如上
2. 故如果添加库路径,直接在/etc/ld.so.conf中新建一行,添加路径
或cd /etc/ld.so.conf.d/, 新建一个xxx.conf文件, 写入库路径
3. /sbin/ldconfig
which ldconfig命令会显示如下
/sbin/ldconfig
直接运行ldconfig, 它的作用是将/etc/ld.so.conf中包含的路径中的库文件缓存到/etc/ld.so.cache,
所以,在ld.so.conf中添加完路径,应该运行下ldconfig, 立即生效
原文:https://www.cnblogs.com/henryliublog/p/10641416.html