Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I hope this is not a very stupid question as I am very new to development in GNU/Linux.

I installed a library(for example lzma-dev) using a package manager(for example apt-get for Debian or Ubuntu). How can I use it? Where can I find the libs and headers? How about sos(dynamic libraries)?

share|improve this question
Essentially, any properly set-up distro will ensure that libraries installed via its package manager can be found in directories that are in the compiler's default search path. (Assuming that the compiler was likewise installed via the package manager) – Shadur Feb 13 '14 at 13:40
@Shadur this means I can just #include <header.h>(for example for c++ libraries) and use it right along without having to think about adding library and include paths to the porject file, right? – Jason Swartz Feb 13 '14 at 14:18
In most cases, yes, although from the looks of @slm's the files will be at /usr/include/<libname> so the include directive you'll likely need would be #include <libname/header.h> – Shadur Feb 13 '14 at 14:37
up vote 3 down vote accepted

Assuming the package has already been installed you can see the contents of it using dpkg -L, for list.


$ dpkg -L lzma-dev

Packages that are named <something>-dev are typically just the C header files (.h files), this package is a bit unusual in that it includes (.c and .h files). Incidentally this is the actual source for the LZMA library.

If you want the .so files and the .h files for the LZMA library, so you can compile against it, you'll need to install the 'liblzma-dev` package.


Here's the header files.

$ dpkg -L liblzma-dev | tail -15

As well as the actual .so library:

$ dpkg -L liblzma5 | tail -4
share|improve this answer
"and the .c and .h files for the LZMA library". The .c files are not packaged. They're source. Also, .so files are not part of a dev library, which just contain header files. The /usr/lib/x86_64-linux-gnu/liblzma.so here is a symbolic link. It points to a file in the library package liblzma5. – Faheem Mitha Feb 13 '14 at 18:31
@FaheemMitha - take a look at the contents of lzma-dev, it does contain .c files. – slm Feb 13 '14 at 18:39
@FaheemMitha - cleaned it up but this is a bit of a confusing example. – slm Feb 13 '14 at 18:45
@FaheemMitha - 12.10, lzma-dev: 9.22-2ubuntu2 – slm Feb 13 '14 at 22:50
dpkg -L lzma-dev

list all the files installed with apt-get for lzma-dev

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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