Even the best-maintained systems acquire cruft from time to time.
cruft package
- a bit slow (hard to avoid really it has to search the whole filesystem)
- a bit clunky
pycruft.py script
Python has an annoying habit of leaving behind a foo.pyc file for every foo.py file that gets imported. If the python interpreter is running as root, cruft accumulates
python-central has several bugs (466244 479852 511197 518490 518940 and others) that cause it to leave .pyc files behind rather than cleaning them up during package upgrades
- This script searches for files in the Python search path that are unknown to dpkg
Run it once for each installed python interpreter (e.g., python2.4 pycruft.py)
- pycruft does not yet search entire filesystem (private modules may also leave behind .pyc files)
obsolete conffiles
grep obsolete /var/lib/dpkg/status | while read file hash status junk; do test -e "$file" && echo "$file"; done
- Does not account for conffiles moving between packages
post-upgrade steps
- find /etc -name '*.dpkg-*'
- find /etc -name '*.ucf-*'
- compare /usr/share/initscripts with installed versions
- compare /usr/share/base-files with installed versions
Default package comparison
- compare set of installed packages to set of packages installed by default in a fresh installation
Configuration files that aren't conffiles; compare these to their installed equivalents
/usr/share/adduser/adduser.conf -> /etc/adduser.conf
/usr/share/initscripts/default.rcS → /etc/default/rcS
/usr/share/readline/inputrc → /etc/inputrc
/usr/share/sysvinit/inittab → /etc/inittab
/usr/share/base-files
dot.bashrc → /root/.bashrc
dot.profile → /root/.profile
motd → /etc/motd
nsswitch.conf → /etc/nsswitch.conf
profile → /etc/profile
/var/lib/dpkg/info
sudo.postinst → /etc/sudo (as of wheezy it's a conffile again)
openssh-server.postinst → /etc/ssh/sshd_config
Runlevel configuration
- Nothing seems to update which runlevels an initscript is enabled for when the values in the LSB headers change. Manifests as warnings during package upgrade.