Shared libraries and what a binary needs
Objective 102.3 is about the libraries a program needs and where they are found. This guide reads the dependencies of the same command on both families, shows the loader's search order by making one directory win, adds that directory to the cache properly and shows it NOT winning - then explains why those two results are different.
101: Installation and Packages Guide 30 of 33 Intermediate
- PlatformsUbuntu 26.04 LTS + AlmaLinux 10.2
- TimeAbout 24 min
- RPM packagingrpm 4.19.1.1, dnf 4.20.0
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| LPIC1-A01 | 192.168.0.76 | Ubuntu 26.04 LTS | Debian-family host - dpkg and apt, which objective 102.4 names | 2 Core | 4 GB | 50 GB |
| LPIC1-B01 | 192.168.0.77 | AlmaLinux 10.2 | RPM-family host - rpm and dnf, which objective 102.5 names | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when a program will not start with an error about a .so file, or when software installed outside the package manager cannot find its own libraries. This matters because the fix depends entirely on which of three mechanisms is in play, and because one of them overrides the others without leaving a trace on disk.
- listing a binary's dependencies with
ldd, and safely withobjdump -p - knowing why
lddshould not be pointed at an untrusted file - reading
/etc/ld.so.confand its drop-in directory on both families - proving
LD_LIBRARY_PATHtakes precedence over the cache - adding a directory to the cache with
ldconfigand confirming it withldconfig -p - explaining why a cached duplicate does not shadow a system library
Before you start
- dpkg-and-rpm-the-low-level-tools
-
What a program needs before it can start
-
Two things ldd will not tell you
-
Where the loader looks, and the cache it looks in first
-
A directory that wins without asking anyone
-
Telling the cache about it properly
-
Putting the machine back