A new shared library has been added to a configured library directory.
Update the normal links and dynamic-linker cache.
Which command should be used?
ldconfig processes configured library directories, updates SONAME links, and rebuilds the dynamic-linker cache.
Detailed explanation
ldconfigCorrect. Running ldconfig updates the configured library links and cache.
Correct. Running ldconfig updates the configured library links and cache.
lddIncorrect. ldd only inspects dependencies of a particular executable.
Incorrect. ldd only inspects dependencies of a particular executable.
updatedbIncorrect. updatedb updates the file-name database used by locate.
Incorrect. updatedb updates the file-name database used by locate.
depmodIncorrect. depmod builds kernel-module dependency information.
Incorrect. depmod builds kernel-module dependency information.
Try it yourself
An example you can run in a temporary verification environment.
ldconfig --help 2>&1 | headExpected result
ldconfigの使用法。キャッシュ更新は実行しないKey points
- ldconfig refreshes the cache
- It manages shared-library links
- Administrative privileges are normally required
Notes
- Environment: Linux / glibc ldconfig
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.