Use it when a program needs a library at build or run time.
Libraries
Libraries are reusable code: static libraries (.a) built into programs and shared libraries (.so) loaded at runtime. Development packages add headers (-dev, -devel).
1. Missing at runtime: ldd <binary> | grep 'not found'.
2. Which package provides it: apt-file search <lib> / dnf provides '*/<lib>'.
3. Install the runtime (and -dev for builds).
4. Version mismatch → match the soname.
5. Re-run.
program linked against a library soname → library installed → loaded at runtime
For Software & Source → Libraries, continue with the first unproven Topic check: Identify the consuming artifact, required API/ABI and exact library candidates visible to the build. If that boundary is healthy, advance to the adjacent check: Capture compiler/linker search paths and the selected object/archive rather than only installed package names. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
dependency requirement → header/API discovery → library candidate/version → compile symbols/types → link resolution → installed/runtime candidate → workload
Healthy evidence: the required API/ABI version is selected consistently at build and runtime and the consuming program resolves required symbols and passes its workload
Step 2 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Identify the consuming artifact, required API/ABI and exact library candidates visible to the build.
- Capture compiler/linker search paths and the selected object/archive rather than only installed package names.
- Inspect runtime dependencies where the artifact uses dynamic linking.
- Exercise functionality that depends on the library and verify the original workload.
Verification chain. dependency requirement → header/API discovery → library candidate/version → compile symbols/types → link resolution → installed/runtime candidate → workload
Step 3 Commands Verify boundary
ldconfig -p | grep ssl
dpkg -S libssl.so.3
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: headers and runtime library versions diverge, duplicate prefixes select another copy, ABI changes hide behind the same filename or static/shared choices differ from intent
Step 5 Common mistakes Narrow the fault
- Copying libraries manually between systems.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Runtime needs the .so; building needs headers too. Library versions follow sonames (libfoo.so.1) — an incompatible upgrade breaks programs linked to the old soname.
git status / git log --oneline -5— repository stateldd <binary>— shared librariesldconfig -p | grep <lib>— libraries in the linker cachemake --version; gcc --version— build tools
ReferenceImportant terms & boundaries5 sections · depth on demand
What this shows and what it does not
A library package/file being present does not show that the build or runtime selected the intended version or compatible ABI.
In depth
Libraries: static, shared and versioned
Most Linux programs use shared libraries, which are loaded at run time and shared between processes. ldconfig(8) maintains the system's view of them:
- It creates the links for the newest versions of shared libraries.
- It builds the cache
/etc/ld.so.cache, from the directories in/etc/ld.so.confand the trusted directories/liband/usr/lib. -pprints the cache.- Libraries follow a link chain such as
libfoo.so→libfoo.so.1→libfoo.so.1.12. The middle name is the SONAME.
Static and shared libraries
Static (.a) | Shared (.so) | |
|---|---|---|
| Linked | Into the program at build time | At run time, by the dynamic linker |
| Security updates | Every program must be rebuilt | Update the library and restart the programs |
| Disk and memory | Duplicated in every program | Shared |
| Deployment | One self-contained file | Dependencies must be present |
| Typical | Go binaries, rescue tools | Almost everything packaged |
Library file names
| File | Purpose | Package (Debian example) |
|---|---|---|
libssl.so.3 | SONAME link used at run time | libssl3 |
libssl.so.3.0.13, or an equivalent real file | The actual library | libssl3 |
libssl.so | Development link used when compiling | libssl-dev |
libssl.a | Static library | libssl-dev (sometimes) |
Library updates need restarts
After a security update of a shared library, running programs keep the old version mapped in memory until they restart. Tools like needrestart (Debian and Ubuntu) and dnf needs-restarting (RHEL) find them. Under the hood, they look for mappings of deleted files in /proc/<pid>/maps.
host$ ldconfig -p | grep -E "libssl\.so|libcrypto\.so" | head -3
libssl.so.3 (libc6,x86-64) => /lib/x86_64-linux-gnu/libssl.so.3
libcrypto.so.3 (libc6,x86-64) => /lib/x86_64-linux-gnu/libcrypto.so.3
host$ ls -l /lib/x86_64-linux-gnu/libssl.so*
lrwxrwxrwx 1 root root 13 Feb 4 2026 /lib/x86_64-linux-gnu/libssl.so -> libssl.so.3
-rw-r--r-- 1 root root 667864 Feb 4 2026 /lib/x86_64-linux-gnu/libssl.so.3
host$ readelf -d /lib/x86_64-linux-gnu/libssl.so.3 | grep SONAME
0x000000000000000e (SONAME) Library soname: [libssl.so.3]
host$ sudo grep -l "libssl.so.3 (deleted)" /proc/*/maps 2>/dev/null | cut -d/ -f3 | xargs -r ps -o pid,comm -p
PID COMMAND
1203 nginx
host$ file /usr/local/bin/tool
Reading the last search
nginx still maps the deleted old copy of libssl, so it's running the vulnerable version despite the update. Restarting nginx loads the new library. This is the check that matters after OpenSSL and glibc updates.
Documented example, not captured output.
How it works at runtime
Libraries is part of Software & Source → Libraries. Libraries covers reusable code dependencies consumed during Linux build or runtime, including development headers, static archives, shared objects, ABI/API compatibility and version selection.
Topic-specific state model. Libraries covers reusable code dependencies consumed during Linux build or runtime, including development headers, static archives, shared objects, ABI/API compatibility and version selection.
Interpretation rule. - Library file present ≠ selected by build/runtime.
- Header compiles ≠ ABI-compatible runtime library.
- Link succeeds ≠ runtime loader selects same dependency.
- Version string ≠ required symbols/behavior verified.
Quick reference
Libraries: static (.a, linked into the binary at build time) and shared (.so, loaded at runtime and shared between programs). Shared libraries get security fixes through package updates without rebuilding applications.
ldd /usr/bin/curl
rpm -qf /usr/lib64/libssl.so.3; dpkg -S libssl.so.3
objdump -p /usr/bin/curl | grep NEEDED
After updating a library, running processes still use the old version until restarted: needs-restarting -s (RHEL) or needrestart (Debian/Ubuntu) list them.
Limits and how it fails
Primary failure point. A library package/file being present does not show that the build or runtime selected the intended version or compatible ABI.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. Libraries owns general dependency and compatibility concepts; Shared Libraries owns ELF dynamic-loader behavior in more detail and Package Management owns packaged dependency transactions.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Software & Source → Libraries. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://git-scm.com/docs · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Libraries operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Libraries.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Libraries covers reusable code dependencies consumed during Linux build or runtime, including development headers, static archives, shared objects, ABI/API compatibility and version selection. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin exact source/revision or recovery point → verify inputs/consistency → observe copy/build/link result → read back destination/artifact and metadata/dependencies → restore/run in intended environment → repeat original workload + regression check. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | dependency requirement → header/API discovery → library candidate/version → compile symbols/types → link resolution → installed/runtime candidate → workload | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | A library package/file being present does not prove that the build or runtime selected the intended version or compatible ABI. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux backup/source evidence can establish this proof path: dependency requirement → header/API discovery → library candidate/version → compile symbols/types → link resolution → installed/runtime candidate → workload | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove unobserved data, metadata, revisions, dependencies, consumers or time periods. A library package/file being present does not prove that the build or runtime selected the intended version or compatible ABI. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven backup/source/build boundary, capture adjacent identity/read-back/runtime evidence, make only the demonstrated persistent change, then repeat the original workload plus a regression check. | Continue to the next unresolved boundary while preserving the original test condition. |
Libraries · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Libraries |
|---|---|
| Topic path | Software & Source → Libraries |
| Runtime state | Libraries covers reusable code dependencies consumed during Linux build or runtime, including development headers, static archives, shared objects, ABI/API compatibility and version selection. |
| Fast checks | - Identify the consuming artifact, required API/ABI and exact library candidates visible to the build. - Capture compiler/linker search paths and the selected object/archive rather than only installed package names. - Inspect runtime dependencies where the artifact uses dynamic linking. - Exercise functionality that depends on the library and verify the original workload. |
| Verification chain | dependency requirement → header/API discovery → library candidate/version → compile symbols/types → link resolution → installed/runtime candidate → workload Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. |
| Failure boundary | A library package/file being present does not prove that the build or runtime selected the intended version or compatible ABI. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |