Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

The libgtest-dev package seems only install header files to the system, but not the static and dynamic libraries which should be installed under /usr/lib.

Is it a bug?

share|improve this question
Since it's intentional, it's not a bug; yet the situation is utterly confusing. I therefore filed a bug report at – Joachim Wuttke Oct 21 '15 at 12:42
ugh... does boost's testing framework "just work" ? – Andrew Wagner Oct 27 '15 at 10:20
up vote 53 down vote accepted

Is it a bug?

No, it's deliberate:

gtest (1.6.0-1ubuntu2) precise; urgency=low

  * Stop distributing static library (although still build it, to ensure gtest
    works).  Upstream recommends against shipping the libary at all, just the
    source. (See:
    The Debian maintainer plans to do this also (see BTS: 639795); do it in
    Ubuntu now to fulfil MIR requirements.

To build static libraries

cd /usr/src/gtest
sudo cmake .
sudo make
sudo mv libg* /usr/lib/
share|improve this answer
Thanks! I've built the libraries in this way. Just thought that it might not be an official approach for a .deb package. – eddyxu Jun 3 '12 at 14:20
The Google works in mysterious ways! :) Glad it helped. – izx Jun 3 '12 at 14:23
Copy-paste version: cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv libg* /usr/lib/ && cd - – exic Jan 16 '13 at 16:05
Actually reason described here can be applied to any library. For example if boost is linked with libstdc++ and you want to use libc++ you need to recompile boost from sources. So it's strange, IMHO – ruslo Oct 23 '13 at 7:51
This is freaking asinine. Why the hell wouldn't they ship the library for the source? Or at least have the package install build it automatically. – Fake Name Nov 26 '15 at 3:48

Improving on izx's answer I would have used cmake this way:


and I would attempt an out-of-source build:

cd /tmp
mkdir .build
cd .build
cmake -DCMAKE_BUILD_TYPE=RELEASE /usr/src/gtest/
sudo mv libg* /usr/lib/
share|improve this answer

It should be a dependency bug , libgtest should be installed along with libgtest-dev.

Can you try apt-get install -y libgtest first ?

Also remember to submit a bug report on ubuntu.

share|improve this answer
libgtest doesn't exist anymore, see my answer :( – izx Jun 3 '12 at 13:06
@izx oh , okay , i'm just guessing from the package name – warl0ck Jun 3 '12 at 13:07
np, I tried that too ;) @warl0ck – izx Jun 3 '12 at 13:08

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.