Dependencies and libraries
In short: Almost no program stands alone. It uses shared libraries (.so files on Linux, .dll on Windows). The packages declare these dependencies so the package manager installs them too.
In more detail: Shared libraries save space and allow security updates in one place. Problem: two programs need different versions of the same library (“dependency hell”).
In detail
- glibc: the GNU C library, the foundation of almost all programs. Alpine uses musl instead (smaller, not compatible everywhere).
- Viewing:
ldd /usr/bin/vlclists required libraries. If one is missing, “error while loading shared libraries” appears. - Statically linked: one file containing everything (e.g. many Go programs). Bigger but without dependencies.
- Solutions: Flatpak/Snap (own runtime), containers, Nix (each version separate).
- Versioning: libraries carry version numbers (
libssl.so.3). Important libraries: glibc, OpenSSL, zlib, libstdc++, GTK, Qt, libc++, ffmpeg. - Tidying up:
apt autoremove,dnf autoremove,pacman -Rns.
See also: Flatpak, Snap and AppImage, Important packages in the Linux base system