如果我在 Debian 上寻找包含特定头文件的包,我可以运行apt-file search filename
来查找该包。这是一个例子:
$ apt-file search X11/Xlib.h
critcl: /usr/share/tcltk/critcl3.1.18/critcl_c/tcl8.4/X11/Xlib.h
emscripten: /usr/share/emscripten/system/include/X11/Xlib.h
ivtools-dev: /usr/include/IV-X11/Xlib.h
libghc-x11-dev: /usr/lib/haskell-packages/ghc/lib/x86_64-linux-ghc-8.8.4/X11-1.9.1-HPfJisIvZwQBMLUniy0WBQ/Graphics/X11/Xlib.hi
libhugs-x11-bundled: /usr/lib/hugs/packages/X11/Graphics/X11/Xlib.hs
libnx-x11-dev: /usr/include/x86_64-linux-gnu/nx-X11/Xlib.h
libx11-dev: /usr/include/X11/Xlib.h
python-pycparser: /usr/share/python-pycparser/fake_libc_include/X11/Xlib.h
python3-pycparser: /usr/share/python3-pycparser/fake_libc_include/X11/Xlib.h
有与此等效的吗pacman
?
答案1
答案是pacman -Fx filename
,如:
$ pacman -Fx X11/xlib.h
usr/include/bullet/ThirdPartyLibs/optionalX11/X11/Xlib.h is owned by extra/bullet 3.24-2
usr/include/bullet/ThirdPartyLibs/optionalX11/X11/Xlib.h is owned by extra/bullet-dp 3.24-2
usr/include/X11/Xlib.h is owned by extra/libx11 1.8.1-3
usr/include/wx-3.2/wx/x11/nanox/X11/Xlib.h is owned by extra/wxwidgets-common 3.2.1-1
usr/lib/emscripten/system/include/X11/Xlib.h is owned by community/emscripten 3.1.23-1