I'm tired of looking for specific files for specific problems, for questions like this one for example.

Now, is there a way for someone to find out by himself what library one should install to have some file?

Conditions:

  • you have the name of the file you want to make available
  • you don't know the name of the library
  • the library is (of course) not installed on your system
link|improve this question
feedback

migrated from stackoverflow.com Aug 7 '11 at 3:47

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 2 down vote accepted

On Debian or Ubuntu, you can ask your package manager about installed packages

dpkg --search <filename>

If the package isn't installed, you can use apt-file

apt-file update
apt-file search <filename>

If you don't know anything about the specific file you're looking for, but you want to know about some specific functionalty (mentioned in the package description)

apt-cache search <keywords>

To search for a package when you know part of the name (even if the package is not installed)

dpkg -l '*pattern*'
link|improve this answer
Dear Ken, this sounds promising. Maybe I'm doing something wrong, because the search apt-file search ncurses shows me 1489 files. I think I need to gather the correct file from the set manually, no? Thanks. – Dr Beco Aug 7 '11 at 3:51
1  
@Dr Beco: I think for that, you want dpkg -l '*ncurses*' (which I just added to the answer). – Ken Bloom Aug 7 '11 at 4:05
Thanks. Very detailed and helpful. If I could, I would +1 it more than once. ;) – Dr Beco Aug 7 '11 at 4:09
feedback

Query your package manager.

yum whatprovides '*/somefile'
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.