Sometimes you need to know if a certain file is in a deb package. The easiest way is to use the web frontend for the repositories like debain packages.

Another way is to use a tool called apt-file.

With this cli tool you can search files for installed and remote packaes.

First install the package:

$ apt-get install apt-file

Update the index:

$ apt-file update

And search for a certain file:

$ apt-file find nginx.conf
cardstories: /usr/share/cardstories/conf/nginx.conf
fcgiwrap: /usr/share/doc/fcgiwrap/examples/nginx.conf
gunicorn: /usr/share/doc/gunicorn/examples/nginx.conf.gz
munin: /usr/share/doc/munin/examples/nginx/munin.nginx.conf
nginx-common: /etc/nginx/nginx.conf
nginx-doc: /usr/share/doc/nginx-doc/examples/nginx.conf
pcp: /var/lib/pcp/pmdas/nginx/nginx.conf
python-cyclone: /usr/share/doc/python-cyclone/examples/helloworld/nginx.conf
thin: /usr/share/doc/thin/examples/myapp.nginx.conf
unicorn: /usr/share/doc/unicorn/examples/nginx.conf.gz
zabbix-frontend-php: /usr/share/doc/zabbix-frontend-php/examples/nginx.conf

This output shows a list of all packages that contain the file nginx.conf and where it is placed in the filesystem.