anol
anol

Reputation: 8953

How to find packages containing a specific file?

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?

Upvotes: 1

Views: 2474

Answers (2)

Tim Lamballais
Tim Lamballais

Reputation: 1054

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).

Upvotes: 0

anol
anol

Reputation: 8953

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).

Upvotes: 2

Related Questions