Yes, there are such files. In particular,
*.postrm , and
*.conffiles, which are all stored in
.postrm files are post-remove scripts, that run after a package is removed. Those scripts are responsibility of the package maintainers, and each script is tailored to the specific package. If you examine
/var/lib/dpkg/info/usb-modeswitch-data.postrm for example , you will see something like this:
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile "/etc/usb_modeswitch.d/230d:0001" 20101222-3 -- "$@"
# End automatically added section
*.conffiles files, which are basically lists.
gnome-terminal.list, for example, will list all files and directories created when
gnome-terminal was installed. The
*.list files are very useful for determining what installed what.
*.conffiles list all the config files for a package. For instance, while
xterm.list gives all the files , `xterm.conffiles* gives only conffiles. In other words, the contents of conffile will also be present in list file.
$ cat /var/lib/dpkg/info/xterm.conffiles
I don't quite know how
*.conffiles work. My assumption is that the post-removal scripts take priority, and
apt-get just uses those
*.conffiles to double check that files listed there were removed.
As @A.B. properly reminded me, there are also
*.prerm files, some of which do remove the .conf files, but not necessarily, for instance the one for
xpdf app was removing the files in