nerdexam
Linux_Foundation

LFCS · Question #705

You are preparing a new set of shared libraries in /usr/local/applib and you have written and compiled some code that uses these libraries. You have already performed an Idconfig, however the system…

The correct answer is D. You forgot to put the library path in ld.so.conf. If new shared libraries are not found after running ldconfig, it is most likely because their path was not added to the ld.so.conf configuration file, which informs the dynamic linker how to locate shared libraries.

Submitted by omar99· Apr 18, 2026Operation of Running Systems

Question

You are preparing a new set of shared libraries in /usr/local/applib and you have written and compiled some code that uses these libraries. You have already performed an Idconfig, however the system still cannot find the shared libraries. What is most likely the cause of this?

Options

  • AYou used the wrong compil|er.
  • BYou did not update your PATH variable.
  • CYou compiled the code with wrong library.
  • DYou forgot to put the library path in ld.so.conf.

How the community answered

(22 responses)
  • A
    5% (1)
  • B
    5% (1)
  • C
    14% (3)
  • D
    77% (17)

Why each option

If new shared libraries are not found after running `ldconfig`, it is most likely because their path was not added to the `ld.so.conf` configuration file, which informs the dynamic linker how to locate shared libraries.

AYou used the wrong compil|er.

Using the wrong compiler would typically lead to compilation errors or incorrect executable behavior, not an inability of the system to *find* shared libraries at runtime if they are correctly installed.

BYou did not update your PATH variable.

The `PATH` variable is used by the shell to locate executable programs, not by the dynamic linker to find shared libraries; library paths are managed by `ldconfig` and `LD_LIBRARY_PATH`.

CYou compiled the code with wrong library.

Compiling with the wrong library would likely result in link-time errors or incorrect program behavior, but the system's dynamic linker would still be able to *find* other shared libraries it has configured.

DYou forgot to put the library path in ld.so.conf.Correct

The `ldconfig` utility builds the necessary links and cache for the dynamic linker. It relies on paths specified in `/etc/ld.so.conf` and directories like `/lib` and `/usr/lib` by default. If a custom library path like `/usr/local/applib` is not explicitly added to `/etc/ld.so.conf` (or a file within `/etc/ld.so.conf.d/`), `ldconfig` will not include those libraries in its cache, causing the system to fail to find them.

Concept tested: Linux dynamic linker configuration

Source: https://man7.org/linux/man-pages/man8/ldconfig.8.html

Topics

#Shared Libraries#Dynamic Linking#ldconfig#ld.so.conf

Community Discussion

No community discussion yet for this question.

Full LFCS Practice