0

I want to find out which packages (if any) contain a specific file name. For instance, I'm trying to compile 32-bit programs in a 64-bit machine and GCC complains about a missing file "gnu/stubs-32.h". How can I quickly find which package I should install?

anol
  • 8,264
  • 3
  • 34
  • 78

2 Answers2

1

If using a Debian-based distribution, you can use apt-file:

apt-file search path/to/filename (but for it to work, you must first populate the database, running apt-file update as root)

If using an RPM-based distribution (Red Hat, Fedora, etc), there is the equivalent yum provides: yum provides path/to/filename, which supports wildcards (for instance: yum provides \*/gnu/stubs-32.h).

anol
  • 8,264
  • 3
  • 34
  • 78
0

A quick google search would also point you to a previous stackoverflow question. There you will find out that you need the 32 bit libc-dev package (libc6-dev-i386).

Community
  • 1
  • 1
Tim Lamballais
  • 1,056
  • 5
  • 10
  • I actually got the example from that question, but the idea of the question was to be more generic: given an arbitrary file name, how to find which packages contain it? The libc example was just to illustrate, but I could find it useful to look for, let's say, all packages which contain references to pthread.h. I did a quick SO search and didn't find a question that seemed similar enought, but if there is one please tell me so I can close this (and find out what was missing in my original search). – anol Oct 01 '12 at 14:19
  • My apologies, in that case @dhekir already answered the question. – Tim Lamballais Oct 01 '12 at 14:22
  • No problem, it's the first time I use the "ask-and-answer in Q&A style", so maybe it should be better rephrased? Any suggestions welcome. – anol Oct 02 '12 at 15:13