Previous Page | Next Page

  1. Introduction
  2. Abbreviated Boot
  3. The Boot Process
  4. Startup and Run Levels
  5. Initialization Scripts
  6. Runlevel Scripts
  7. Login Process
  8. Bash Shell
  9. Filesystems
  10. LILO, Kernel and Root Filesystem
  11. The Kernel
  12. Passwords, Users, Groups, and Quotas
  13. The Environment
  14. The /etc/sysconfig directory
  15. The /proc filesystem
  16. Process Control
  17. Devices
  18. Daemons Services
  19. Inetd and Network Services
  20. Programs and Libraries
  21. Security and PAM
  22. The printer services
  23. Mouse support with gpm
  24. Mail
  25. News
  26. UUCP
  27. LDAP
  28. NFS and RPC
  29. Samba, NetBIOS, WINS, nmbd
  30. Identd (auth)
  31. Telnet and FTP
  32. Apache web server
  33. DNS and named
  34. How X Works
  35. X Scripts
  36. Support for Text
  37. Keymapping for Programs
  38. Keycode Table
  39. Example Keymap File
  40. Terminfo Commands
  41. VT100 ESC sequences
  42. Kernel Revisited
  43. Configuration Files
  44. Credits

Linux Dependencies on Programs and Shared Libraries

The operating and its binaries are currently designed to rely on shared libraries, much like dynamically linked libraries (DLLs) in the windows environments. Therefore most binarys, such as init, login, ls, cp, to name a few will likely use some shared library. Loadable modules are loaded into the kernel by the program "/sbin/insmod". Most libraries are in the /lib directory. The libncurses.so.4 library is in /usr/lib. The file "/etc/ld.so.conf" contains a list of directory locations where the system finds its library files. See the man page on ldconfig. The program ld.so is the dynamic linker the programs use to load and run the shared library. Librarys that contain the same major number are compatible with programs that require that major number, but not compatible with programs requiring a different major number. The file /etc/ld.so.conf contains a list of directories that the linker will search to find shared library files. If you add entries to their file, use the "ldconfig" command afterwards to regenerate the shared library cache. The environment variable LD_LIBRARY_PATH can add more directories to this search path. For each library there are generally two separate files. One with a .a or .o extension is the static version, linked in at compile time, and .so.version which is the dynamically linked version. The static files are usually in /usr/lib. When changing dynamic link files use "ln -sf" to change it rather than removing it and replacing it since temporarily removing a library file may stop many functions from working.
Standard libraries:

  • libc - standard c library
  • libm - Standard math library

How to determine what library a binary needs

Using the "ldd" command, type "ldd /bin/ls" to see the shared libraries used by the "ls" command. Do the same for any other binary you are interested in. This way if a binary (newly created, down loaded, etc) requires a library you can check your "lib" directory to see if it is there. If it is not, you will need to create and install it.

How to tell if a library is a.out or ELF type

Type "file library.so.x", substituting the name of your library for "library.so.x". If ELF is used the loader library "ld-linux.so" is required, and if a.out is used, "ld.so" is required.