ldconfig is a system utility in Ubuntu and other Linux-based systems that manages the system’s dynamic linker run-time bindings. More concretely, it helps the operating system track and locate the dynamic libraries (.so files) used by various programs.
Key points about ldconfig:
1. Function:
When applications are executed, they rely on libraries (collections of precompiled functions) to perform various tasks. If these libraries are dynamically linked—loaded at runtime rather than statically compiled into the binary—then the system must know where to find them. ldconfig scans specified directories (commonly /lib, /usr/lib, and any directories listed in /etc/ld.so.conf), identifies dynamic libraries, and updates /etc/ld.so.cache. This cache allows the dynamic linker (ld.so for standard ELF binaries) to quickly locate the necessary libraries when programs start.
2. When You Need It:
• After installing new libraries, especially if they aren’t placed in standard locations, you’ll often run sudo ldconfig to ensure that the system is aware of the new libraries.
• After altering /etc/ld.so.conf or creating new configuration files in /etc/ld.so.conf.d that point to non-standard library directories, running ldconfig updates the library cache accordingly.
3. System Integration:
In many cases, package managers and installation scripts run ldconfig automatically after installing or removing libraries, so most users rarely need to invoke it manually. However, knowing about ldconfig is essential if you are compiling software from source or manually placing libraries in non-default locations.
4. Usage:
Typical usage involves running sudo ldconfig without extra arguments, which updates the cache based on standard directories and configurations. You can use command-line arguments like ldconfig -p to print out the current library cache, or specify additional paths to process with ldconfig /path/to/lib.
In summary, ldconfig ensures that the operating system always knows where to find the dynamically linked libraries required by applications, thus maintaining a coherent and functioning runtime environment.
'Ubuntu' 카테고리의 다른 글
Directories - 1 (0) | 2025.01.16 |
---|---|
Directories 2 (0) | 2025.01.16 |
기본 Library PATH의 설정 (0) | 2024.12.13 |
파일 또는 디렉토리 존재여부 확인 방법 (0) | 2024.12.11 |
TMUX를 이용한 프로그램 실행 (0) | 2024.05.16 |