简体   繁体   English

如何查找包含特定文件的软件包?

[英]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". 例如,我试图在64位计算机上编译32位程序,而GCC抱怨缺少文件“ 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: 如果使用基于Debian的发行版,则可以使用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) apt-file search path/to/filename (但要使其正常工作,必须首先填充数据库,并以root身份运行apt-file update

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 ). 如果使用基于RPM的发行版(Red Hat,Fedora等),则yum provides了等效功能: yum provides path/to/filename ,它支持通配符(例如: yum provides \\*/gnu/stubs-32.h )。

A quick google search would also point you to a previous stackoverflow question. 谷歌的快速搜索可以将您指向先前的 stackoverflow问题。 There you will find out that you need the 32 bit libc-dev package (libc6-dev-i386). 在那里,您将发现需要32位libc-dev软件包(libc6-dev-i386)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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