linux borrar configuracion residual

C++
dpkg -l | grep '^rc' | awk '{print $2}' | xargs dpkg --purge
Source

Also in C++: