Purging and rebuilding ldconfig cache?

[亡魂溺海] 提交于 2020-01-22 10:30:49

问题


I am trying to purge the ldconfig cache of links to libraries to link against. I have a local folder where newly built libraries are placed. I want to update the ldconfig cache to point to these newly built libs.

I have tried using the ldconfig -c command, giving it my own .conf file. I also tried replacing the /etc/ld.so.conf file to point to the new path of libs. But even after doing this, when I check the cache using the ldconfig -p command , it is still showing the old libs.

Hence how to purge and rebuild the ldconfig cache? Just to add : I am on Ubuntu 13.10.


回答1:


2 years late, but in case someone stumble upon this, as su, run the following commands:

rm /etc/ld.so.cache
ldconfig



回答2:


Rebuild cache

Open the /etc/ld.so.conf as sudo and add a new line with the library directory. In this case, we add /usr/local/lib. Rerun ldconfig to rebuild the cache:

$ sudo ldconfig

This worked for me.




回答3:


I solved the problem by doing the following:

$ > /etc/ld.so.cache

then:

$ ldconfig



来源:https://stackoverflow.com/questions/21758828/purging-and-rebuilding-ldconfig-cache

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!