Site Tools


path-lib

Table of Contents

/lib

/lib holds the shared libraries required by the binaries in /bin and /sbin. These are the .so files the dynamic linker loads at runtime. The C standard library (libc.so.6), the dynamic linker itself (ld-linux.so.2), and kernel modules all live here. The constraint is the same as for /bin: these libraries must be available before other filesystems are mounted, because /bin/sh and the other boot-critical binaries link against them.

/lib/x86_64-linux-gnu/libc.so.6     C standard library
/lib/x86_64-linux-gnu/libm.so.6     math library
/lib/x86_64-linux-gnu/libpthread.so.0  POSIX threads
/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2  dynamic linker
/lib/modules/6.1.0-28-amd64/        kernel modules for this kernel version

/lib/modules/$(uname -r)/ stores loadable kernel modules — the .ko files for device drivers, filesystems, and other kernel extensions that are not compiled in. modprobe and insmod load them on demand. The lib32 and lib64 suffixes (or architecture triplets like x86_64-linux-gnu) distinguish libraries for different word sizes on multiarch systems.

On modern distributions using merged /usr, /lib is a symlink to /usr/lib, consolidating all libraries there. The symlink preserves compatibility with paths hardcoded into old binaries and build systems.

path-lib.txt · Last modified: by 127.0.0.1