Debian

如何從系統中安裝的每個包的已安裝文件列表中搜尋文件

  • October 7, 2020

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

您可以使用以下命令搜尋包中的文件名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

引用自:https://unix.stackexchange.com/questions/613272