How to make an upgraded system clean by automatically removing abandoned config files?



I've noticed some abandoned configuration files have been left lying around
my harddrive, which by their existence have a (sometimes negative) effect on
my upgraded system. They were installed by packages in lenny, but would not
be installed in a fresh installation of squeeze. Despite unmodified
configuration files getting replaced by newer ones when upgrading, it seems
that if they don't belong to the same package in squeeze as in lenny, then
they are not removed... even though that file may be unmodified from the
original (and now useless or even harmful.)

For example, there's the /etc/X11/xorg.conf file that dpkg-reconfigure
doesn't change or remove in squeeze (and doesn't add, if there's not one
there.)
Also, there was a file in /etc/udev/rules.d/ for wacom input. Something like
50 errors would show up when I booted, because of this file.

I noticed that using the "loate" command for the xserver-xorg-input-wacom
package listed the problematic rules file, so my system knew that it was
there and associated with the package. I tried purging the wacom package and
reinstalling xserver-xorg-input-all. The file and the problem went away.
Unfortunately, I don't think that it's feasible to purge and reinstall the
entire installation base though ;-) so I'm still looking for a general
solution.

Is there a way to remove deprecated files like these automatically? I'm
having some minor issues with squeeze, and I can't help but wonder if there
are still some "zombie" config files that are creating issues here by making
my system less like a clean install of squeeze.

Any help is appreciated.

Thanks,
-Drew


Relevant Pages