我怎么知道哪个文件夹是由哪个程序创建的?

DK *_*ose 6 filesystem package-management directory

我有/usr/share/gtksourceview-2.0/并且我认为这可能是由于MousepadGeanyMedit文本编辑器造成的。但是,如果不卸载它们并一一重新安装,我怎么能确定呢?

(我不知道要使用什么标签,所以我放了gtk。)

edw*_*win 6

尝试:

apt-cache depends <package-name>  |  grep gtksourceview
Run Code Online (Sandbox Code Playgroud)

使用鼠标垫,我得到了这个:

$ apt-cache depends mousepad | grep gtksourceview
  Depends: libgtksourceview2.0-0
Run Code Online (Sandbox Code Playgroud)

其他的(Geany 和 Medit)不依赖于 GtkSourceView 的 2.0 版。


作为旁注,要检查哪些包提供了目录/文件,您可以使用dpkg -S <package-name>该文件是在您的系统中还是apt-file在一般情况下:

dpkg -S /usr/share/gtksourceview-2.0       # local file/directory
apt-file find /usr/share/gtksourceview-2.0 # works even if the file is not installed
Run Code Online (Sandbox Code Playgroud)

由于apt-file默认情况下未安装,因此您需要安装sudo apt-get install apt-file. 使用上面的命令,我得到了(在其他结果中)包libgtksourceview2.0-common. 现在我可以apt-cache rdepends用来寻找直接/间接提供目录的包:

$ apt-cache rdepends libgtksourceview2.0-common
libgtksourceview2.0-common
Reverse Depends:
  libgtksourceview2.0-0
  libgtksourceview2.0-0

$ apt-cache rdepends libgtksourceview2.0-0 | grep 'geany\|medit\|mousepad'
  mousepad
Run Code Online (Sandbox Code Playgroud)

这似乎也有效(并且可能更通用):

apt-cache rdepends libgtksourceview2.0-common \
  --recurse \
  --no-recommends \
  --no-suggests | grep 'geany\|medit\|mousepad'
Run Code Online (Sandbox Code Playgroud)

  • 虽然 `apt-file` 确实很有用,但要找到 _already 在您的系统上的文件的所有者,我认为使用 `dpkg -S &lt;filename&gt;` 可能更有效 (3认同)