Tag Archives: apt-file

Find the library or program that installs a specific file with apt-file

Sometime you could end up in a situation where you need to know which program or library installs a file. That happened to me while installing redmine. I got an error telling me that it couldn’t find the MagickWand.h file. apt-file tells you the library you need to install to get that file.

$ sudo apt-get install apt-file
$ sudo apt-file update
$ apt-file search MagickWand.h
imagemagick-doc: /usr/share/doc/imagemagick/www/api/MagickWand/struct__MagickWand.html
libmagickwand-dev: /usr/include/ImageMagick/wand/MagickWand.h

Thus I installed libmagickwand-dev and the problem went away:

sudo apt-get install libmagickwand-dev