[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Find which package has installed some file under /etc



Vincent Lefevre wrote:
> Is there a way to find which package has installed some file
> under /etc?

Yes, if the package owns the file.  No, if the package put it there
but didn't keep ownership of it.

> For conffiles, there is dlocate or "dpkg -S",

Exactly!  If the package kept track of the file as a conffile then you
can locate it with 'dpkg -S'.

> but what about the other files (installed in postinst)?

Then the answer is No.  There isn't a database for it.

But if the package's postinst is still current then you should be able
to locate the script that did it.  Assume that /etc/foofile is the
file from /etc.

  grep foofile /var/lib/dpkg/info/*.postinst

That should locate the script the references it.  If the script is
still current.  If the package was purged and the file left behind
then nothing will be found.  If the file was left behind by a previous
version of the postinst script which was subsequently update to a
newer version that no longer references it then nothing will be found.
But if it still references it then you should be able to locate the
package by the script doing it.  (Sorry for this being confusing.)

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: