0

Example:

I am looking for a universal solution to check any file path and the answer should be the package name (names if there is more then one) or reliable answer, that the file path was created by a user (i.e. not by apt install).

mvorisek
  • 209
  • The user may be whatever service user is running bind though... – Kusalananda Feb 23 '20 at 13:18
  • @Kusalananda No, I do not need an user name. I need a package name or an answer, that the file was not created by apt package. – mvorisek Feb 23 '20 at 13:31
  • 4
    like dpkg-query -S FILE? https://superuser.com/a/179354 – guest Feb 23 '20 at 13:34
  • @guest Yes, thank you very much! – mvorisek Feb 23 '20 at 13:43
  • 2
    It depends a bit what you mean by "created" - dpkg-query -S (or dpkg -S) will find files that are installed directly from the package archive, however there are sometimes additional files created by package installation scripts, which AFAIK it will not show. – steeldriver Feb 23 '20 at 13:46
  • @steeldriver Good point, I meant mainly the files that are listed like here https://packages.debian.org/buster/amd64/bind9/filelist - and for these the dpkg-query -S seems to work very well. – mvorisek Feb 23 '20 at 13:49
  • My point was that some files may well be created by running a program rather than by installing its package. Some files may well be created by daemon accounts in this way. – Kusalananda Feb 23 '20 at 13:53
  • etc keeper, may also be of help. However you have to install it before the other packages. – ctrl-alt-delor Feb 23 '20 at 14:07

0 Answers0