Even the best-maintained systems acquire cruft from time to time.
- a bit slow (hard to avoid really it has to search the whole filesystem)
- a bit clunky
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
- 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)
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
- 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
dot.bashrc → /root/.bashrc
dot.profile → /root/.profile
motd → /etc/motd
nsswitch.conf → /etc/nsswitch.conf
profile → /etc/profile
sudo.postinst → /etc/sudo (as of wheezy it's a conffile again)
openssh-server.postinst → /etc/ssh/sshd_config
- 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.