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

You might also like

Change root’s password when sudoers file is misconfigured and sudo won’t work
If you misconfigure the sudoers file you may end up in a situation where you wouldn't be able to use...

Avoid Android File Transfer starting automatically in Mac OS X after Android device plugin to USB port
"Android File Transfer" application starts automatically in Mac OS X when you plug your Android device...

Avoid Android File Transfer starting automatically in Mac OS X after Android device plugin to USB port
"Android File Transfer" application starts automatically in Mac OS X when you plug your Android device...

VNC service start and stop with a script in Mac OS X
Create a file called, for example, startVNC and fill it with:sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart...

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.