List files in a package
dpkg -c <package_name>.deb
dpkg -L <package_name>
Find which package provides a file
dpkg -S /path/to/file
Get package info:
dpkg --info <package_name>.deb
List installed packages whose names contain foo
:
dpkg -l '*foo*' | grep '^ii'
Post removal and post installation scripts are located at /var/lib/dpkg/info
.