13

In which directory does the libpthread library reside on a Linux system ?

Bruce Becker
  • 335
  • 1
  • 6
  • 23
Dew
  • 2,993
  • 5
  • 17
  • 7
  • Hi - your question refers to a generic "Linux system" - this is a bit too vague to answer clearly. Could you please specify which OS/arch you are referring to ? – Bruce Becker Jan 16 '17 at 15:26

6 Answers6

9

There are a number of ways to find this out.

Simply type find / -name 'libpthread.so' -print to find the file named libpthread.so on your system.

You can check the library locations your dynamic linker ld checks in for libraries, which are listed in /etc/ld.so.conf.

Also, if you are running a debian-based distro, or have dpkg installed, you can use dpkg -S libpthread, which will give you the packages that contain files with the name libpthread and where those files are installed. Distros with RPM support should have a similar feature. Hope this helps!

Sean Kelleher
  • 1,952
  • 1
  • 23
  • 34
7

You can try the following command = locate libpthread.so

it gave the following output when I tried :

/lib/i386-linux-gnu/libpthread.so.0
/usr/lib/i386-linux-gnu/libpthread.so
spd
  • 103
  • 1
  • 7
5

In Ubuntu 16.04.2 and Oracle Linux OS 6.8, you can run the following command:

ldconfig -p | grep pthread.so

Sample output:

libpthread.so.0 (libc6,x86-64, OS ABI: Linux 2.6.32) => /lib/x86_64-linux-gnu/libpthread.so.0
libgpgme-pthread.so.11 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libgpgme-pthread.so.11
Jonathan L
  • 9,552
  • 4
  • 49
  • 38
2

The pthreads run time library usually lives in /lib, while the development library usually lives in /usr/lib. This can vary by distribution, but this is at least the location on Debian and Ubuntu and I doubt other mainstream distributions use anything else.

Tollef Fog Heen
  • 201
  • 1
  • 1
1

In Ubuntu it is located in usr/lib/i386-linux-gnu/. At least, it is the path on my system!

Hamed
  • 202
  • 1
  • 4
  • 10
0

Another simple way:

ldd /bin/tar | grep pthread
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f803cdd4000)
firo
  • 1,002
  • 12
  • 20