Wednesday, May 9, 2012

apt-file is your friend

Have you ever wondered in which package a library was provided? I did.

Usually, I looked on google to understand in which package the file was located and often I finished with 5 packages installed whereas only one was needed. To solve this problem, apt-file exists:


  1. First install it:  sudo apt-get install apt-file
  2. Then, update it's database so that all the information is fetched in the repository:
    sudo apt-file update
Now you can use the tool: let's I downloaded some free code sample using the library ANN.h, in which package is it located:

apt-file search ANN.h

The result is the following:

libann-dev: /usr/include/ANN/ANN.h
libmadlib-dev: /usr/include/MAdLib/ANN.h

What does it mean? It means that 2 packages have the expected file: the first one is called libann-dev (What a surprise!) and the file I am looking for would be (when installed) in /usr/include/ANN/ANN.h. The second one is called libmadlib-dev and the file would be in: /usr/include/MAdLib/ANN.h

No comments:

Post a Comment