I've been trying to determine if my Ubuntu (linux) system has -static libraries. When would they be located, and what suffix would identify them?


On debian-derived systems like Ubuntu, the static libraries that come with the system (installed by apt/dpkg, not by hand) usually go in /usr/lib/<target-triplet>/ and have the suffix .a.

Example, on my x86-64 debian system:

$ ls /usr/lib/x86_64-linux-gnu/*.a

apt-get install <package>-dev will usually install such libraries in addition to the dynamic *.so ones.

There are still packages which install their libraries directly under /usr/lib though, eg. libgraphicsmagick1-dev.

Compilers like gcc and clang will also install some "internal" libraries (libstdc++, etc) under /usr/lib/<compiler-name>/..., eg:


Other distros may follow different conventions; for instance, in rhel/centos, all the development libraries go under /usr/lib64/ or /usr/lib32/ and they're provided by <package>-devel-*. Compiling a file with gcc -v will always tell you where exactly the compiler is looking for libraries, whether static or dynamic.

| improve this answer | |
  • THANK YOU. That's exactly what I needed! – Dickster Jun 24 '19 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.