3 ms·
> dpkg -S path/to/file In the case of config files, this only seems to work sometimes -- maybe if it wasn't modified by the user? Or if it came from a pack
by perlgeek 8y ago
> dpkg -S path/to/file
In the case of config files, this only seems to work sometimes -- maybe if it wasn't modified by the user? Or if it came from a package directly, and wasn't generated from its {pre,post}inst scripts?
$ dpkg -S /etc/hosts
dpkg-query: no path found matching pattern /etc/hosts
$ dpkg -S /etc/resolv.conf
dpkg-query: no path found matching pattern /etc/resolv.conf
$ dpkg -S /etc/bash_completion
bash-completion: /etc/bash_completion
- JoshTriplett 8y ago`dpkg -S /path/to/file` only works if the file belongs to a package. `/etc/resolv.conf` gets created dynamically at runtime. `/etc/hosts` gets created at installation time because it includes the hostname (which ought to get replaced with nss-myhostname).