I'm using Ubuntu 14. I'm trying to install GNU Radio and, when I try to configure, pthread library is missing. I then do:

sudo apt-get install pthread

I get this as return:

akula@akula:~/OpenBts/gnuradio-3.4.0$ cd ~
akula@akula:~$ sudo apt-get install pthread
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package pthread

I already did all kinds of updates and everything else I found on the internet.

If anyone could help me, I would be grateful.

  • 2
    What is the exact error message (that prompts you to install libpthread)?
    – edwin
    Apr 23 '14 at 18:00
  • 1
    Why do you want to install pthread? Its a C library available by default.
    – jobin
    Apr 23 '14 at 18:04

The correct name of the package is libpthread-stubs0-dev:

sudo apt-get install libpthread-stubs0-dev
  • 1
    It's already installed in 15.10 at least.
    – the_drow
    Dec 6 '15 at 17:56
  • 9
    Sorry I m late to the party... But I've always been wondering: how the hell do you know/find out the name of that package? There is no way you just guess such a name! Jul 15 '17 at 10:29
  • 4
    You still kind of have to know the package name, but apt search pthread is helpful for listing packages that mention pthread.
    – benf
    Sep 1 '17 at 21:05

sudo apt-get install libpthread-stubs0-dev seems to do nothing.

gcc -lpthreads will still result in a missing pthreads error. gcc -lpthread will still result in a missing pthreads error.

Use instead: gcc -pthread and get a missing main function error. This is expected behavior if everything else is okay.

This flag works on example pthread C file programs.

In Mint (thus Ubuntu) The file /lib/x86_64-linux-gnu/libpthread-2.31.so is in the libc6:amd64 package.

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.