![如何从系统中安装的每个软件包的已安装文件列表中搜索文件](https://linux22.com/image/181356/%E5%A6%82%E4%BD%95%E4%BB%8E%E7%B3%BB%E7%BB%9F%E4%B8%AD%E5%AE%89%E8%A3%85%E7%9A%84%E6%AF%8F%E4%B8%AA%E8%BD%AF%E4%BB%B6%E5%8C%85%E7%9A%84%E5%B7%B2%E5%AE%89%E8%A3%85%E6%96%87%E4%BB%B6%E5%88%97%E8%A1%A8%E4%B8%AD%E6%90%9C%E7%B4%A2%E6%96%87%E4%BB%B6.png)
Synaptic
可以选择从不同的来源进行搜索(包名称、描述、名称和描述等)...但是如果您的系统中安装了一个包,Synaptic 可以向您显示该安装附加了哪些文件。
所以,什么命令可以提取所有已安装软件包生成的所有文件列表以进行搜索?
例如,昨天我想知道我的系统中安装了哪些包 ICC 配置文件,但我必须手动(使用 Synaptic 过滤器)读取每个已安装包的所有已安装文件...我不知道是否有更多的.ICC
。
我请求的命令的示例输出是:
$ ./search --show-origin --show-package '*.icc'
buster-backports krita /usr/share/colors/icc/krita/cmyk.icc
buster colord /usr/share/colors/icc/colord/sRGB.icc
bullseye ghostscript /usr/share/colors/icc/ghostscript/ps_cmyk.icc
答案1
您可以使用以下命令搜索包中的文件名dpkg -S
:
-S, --search filename-search-pattern... Search for a filename from installed packages.
$ dpkg -S '*.icc'
colord-data: /usr/share/color/icc/colord/x11-colors.icc
libgs9-common: /usr/share/color/icc/ghostscript/lab.icc
libgs9-common: /usr/share/color/icc/ghostscript/scrgb.icc
colord-data: /usr/share/color/icc/colord/Gamma6500K.icc
libgs9-common: /usr/share/color/icc/ghostscript/esrgb.icc
colord-data: /usr/share/color/icc/colord/CIE-RGB.icc
colord-data: /usr/share/color/icc/colord/Gamma5000K.icc
colord-data: /usr/share/color/icc/colord/ProPhotoRGB.icc
colord-data: /usr/share/color/icc/colord/EktaSpacePS5.icc
colord-data: /usr/share/color/icc/colord/ECI-RGBv2.icc
libgs9-common: /usr/share/color/icc/ghostscript/srgb.icc
libgs9-common: /usr/share/color/icc/ghostscript/sgray.icc
colord-data: /usr/share/color/icc/colord/BetaRGB.icc
libgs9-common: /usr/share/color/icc/ghostscript/ps_rgb.icc
colord-data: /usr/share/color/icc/colord/AppleRGB.icc
libgs9-common: /usr/share/color/icc/ghostscript/default_gray.icc
colord-data: /usr/share/color/icc/colord/BruceRGB.icc
colord-data: /usr/share/color/icc/colord/Gamma5500K.icc
libgs9-common: /usr/share/color/icc/ghostscript/a98.icc
libgs9-common: /usr/share/color/icc/ghostscript/ps_gray.icc
colord-data: /usr/share/color/icc/colord/Rec709.icc
libgs9-common: /usr/share/color/icc/ghostscript/default_rgb.icc
colord-data: /usr/share/color/icc/colord/AdobeRGB1998.icc
colord-data: /usr/share/color/icc/colord/WideGamutRGB.icc
libgs9-common: /usr/share/color/icc/ghostscript/default_cmyk.icc
colord-data: /usr/share/color/icc/colord/ECI-RGBv1.icc
colord-data: /usr/share/color/icc/colord/sRGB.icc
colord-data: /usr/share/color/icc/colord/NTSC-RGB.icc
colord-data: /usr/share/color/icc/colord/BestRGB.icc
colord-data: /usr/share/color/icc/colord/DonRGB4.icc
colord-data: /usr/share/color/icc/colord/ColorMatchRGB.icc
colord-data: /usr/share/color/icc/colord/SwappedRedAndGreen.icc
colord-data: /usr/share/color/icc/colord/Bluish.icc
libgs9-common: /usr/share/color/icc/ghostscript/rommrgb.icc
libgs9-common: /usr/share/color/icc/ghostscript/gray_to_k.icc
colord-data: /usr/share/color/icc/colord/PAL-RGB.icc
colord-data: /usr/share/color/icc/colord/Crayons.icc
colord-data: /usr/share/color/icc/colord/SMPTE-C-RGB.icc
libgs9-common: /usr/share/color/icc/ghostscript/ps_cmyk.icc