ldconfig命令_在Linux中使用ldconfig命令管理库

ldconfig命令用于管理Linux系统的动态库。这些库存在于/lib64, /lib和/usr/lib等目录下,动态库通常以.so为扩展名。当可执行文件所需的库不在标准路径时,可以通过修改LD_LIBRARY_PATH环境变量添加新路径。使用ldconfig命令可以更新缓存,确保系统能找到正确的库路径。" 78314685,6307555,破解Web200:南宁网络与信息安全技术竞赛中的Node.js漏洞利用,"['信息安全', 'web开发', 'Node.js', '安全漏洞', '网络攻防']
摘要由CSDN通过智能技术生成
ldconfig命令

ldconfig命令

Linux applications, tools, services uses libraries to get necessary functionalities. Libraries provides a lot of functionality to the related applications, tools and services. One library can be used by different applications. This is called dynamic library using or loading.

Linux应用程序,工具和服务使用库来获取必要的功能。 库为相关的应用程序,工具和服务提供了很多功能。 一个库可以由不同的应用程序使用。 这称为使用或加载的动态库。

共享库 (Shared Libraries)

Shared libraries reside in /lib , /lib64 and /usr/lib . Each library is put into related directories like apt , gcc or similar. Dynamic libraries generally have extension .so but there are also some version related numbering.

共享库位于/lib/lib64/usr/lib 。 每个库都放在相关的目录中,例如aptgcc或类似目录。 动态库通常具有扩展名.so但也有一些与版本相关的编号。

For example libvte.so.9 is a dynamic library for vte which version is 9 .

例如, libvte.so.9vte的动态库,版本为9

Shared Libraries
Shared Libraries
共享库

将路径添加到ldconfig(Add Path To ldconfig)

Some times the required libraries for the executable is not located in the standard paths. The default library path is hold in LD_LIBRARY_PATH environments variable. We should add new path to this variable. In the example we assume that the new library path is /foo

有时,可执行文件所需的库不在标准路径中。 默认库路径保存在LD_LIBRARY_PATH环境变量中。 我们应该为该变量添加新路径。 在示例中,我们假设新的库路径为/foo

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/foo
Add Path To ldconfig
Add Path To ldconfig
将路径添加到ldconfig

重建缓存 (Rebuild Cache)

ldconfig is located at /etc/ld.so.conf which content is like below. We will add the library path with include command. The final content will be like below.

ldconfig位于/etc/ld.so.conf ,其内容如下。 我们将使用include命令添加库路径。 最终内容将如下所示。

include /etc/ld.so.conf.d/*.conf 
include /foo

Now we will run the ldconfig -p command to read configuration file and rebuild the cache.

现在,我们将运行ldconfig -p命令来读取配置文件并重建缓存。

$ ldconfig -p
LEARN MORE  What Is DLL (Dynamic Link Library) File?
了解更多什么是DLL(动态链接库)文件?

翻译自: https://www.poftut.com/manage-libraries-ldconfig-command-linux/

ldconfig命令

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值