5

I'm not sure if it is possible, but if it is, how can I find all the files related to a software? For example, is there any way to find all files that gedit needs and uses to work?

Does such command/techniques gather files like /usr/share/gtksourceview-3.0/styles/oblivion.xml which is not dedicated only to a certain software or owned by a different one?

2 Answers 2

6

To list files belonging to a package, run

$ dpkg -L packagename

Note: does not include configuration files, usually.

To find the package a file belongs to, run

$ dpkg -S /path/to/file
4

This is a non-trivial problem, I'm afraid. Some approaches that might help you:

  • You can find all the files installed by a particular package by looking in /var/lib/dpkg/info/gedit.list.

  • You can find all of the other packages on which gedit depends by running apt-cache depends gedit. (Conversely, you can find all the packages which depend on gedit with apt-cache rdepends gedit). Bear in mind that these functions aren't recursive - for gedit to successfully run requires a great deal of your system - eg, the C library, the X graphics system, the dbus system message bus...

  • You can find out which library files an executable requires at runtime by running ldd $(which gedit). (which gedit returns the path to the actual executable run when you run gedit, in this case /usr/bin/gedit).

  • You can find out which files a given process has (currently) open by running lsof -c gedit. (The program may load files, eg icons into memory at startup and close their file descriptors, which won't show up in such a list).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .