Quantcast
Viewing all articles
Browse latest Browse all 4462

Find default library paths location in Ubuntu

I'm on an Ubuntu 22.04 system and I'm working with C language and libraries.

I know (from different books, included "The Linux Programming Interface" by Kerrisk) that this algorithm is used when looking for runtime shared libraries locations (I just omitted the preloaded libraries for the sake of simplicity):

When RUNPATH field is specified (i.e. DT_RUNPATH is non-empty)

  1. LD_LIBRARY_PATH
  2. runpath (DT_RUNPATH field)
  3. ld.so.cache
  4. default library paths (/lib and /usr/lib)

In the absence of RUNPATH (i.e. DT_RUNPATH is empty string)

  1. RPATH
  2. LD_LIBRARY_PATH
  3. ld.so.cache
  4. default library paths (/lib and /usr/lib)

The problem is that most books say that generally speaking the default library paths are /lib and /usr/lib but they don't mention how I can get the exact default library paths for my system.

  1. What command can I use on my Ubuntu 22.04 system to get the exact default library path?

Viewing all articles
Browse latest Browse all 4462

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>