How to purge residual config packages on Debian and Ubuntu
The apt package management system often ends up uninstalling packages but leaving behind their configuration files. For many years it’s been easy to find them using the command dpkg -l | grep --perl-regexp '^rc'
, but it required fiddling around with shell commands to purge the packages (remove the leftover configuration files) because apt didn't support a way of filtering them by installation state. Since apt version 2.0 this is no longer the case, but I always forget the command and searching online usually turns up the old and overly complicated way of doing it.