Purging and rebuilding ldconfig cache?

2020-05-30 03:08发布

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.

3条回答
做自己的国王
2楼-- · 2020-05-30 03:32

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.

查看更多
Animai°情兽
3楼-- · 2020-05-30 03:46

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

rm /etc/ld.so.cache
ldconfig
查看更多
别忘想泡老子
4楼-- · 2020-05-30 03:50

I solved the problem by doing the following:

$ > /etc/ld.so.cache

then:

$ ldconfig

查看更多
登录 后发表回答