Dew
Dew

Reputation: 3163

pthread Library location

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

Upvotes: 14

Views: 62566

Answers (6)

Jonathan L
Jonathan L

Reputation: 10688

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

Upvotes: 6

firo
firo

Reputation: 1062

Another simple way:

ldd /bin/tar | grep pthread
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f803cdd4000)

Upvotes: 1

Sean Kelleher
Sean Kelleher

Reputation: 2102

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!

Upvotes: 10

spd
spd

Reputation: 113

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

Upvotes: 8

Hamed
Hamed

Reputation: 212

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

Upvotes: 2

Tollef Fog Heen
Tollef Fog Heen

Reputation: 221

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.

Upvotes: 3

Related Questions