简体   繁体   中英

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?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM