Here is a little Fedora-oriented shell script to tell how long it’s been since any program included in a given RPM has been accessed, i.e., used. Packages that show no usage in many days might be considered for deletion.
#! /bin/sh MINDAYS=${MINDAYS-7} rpm -q -a "$@" | while read rpm; do rpm -ql "$rpm" | egrep '/bin|/sbin|/lib' | while read file; do echo `stat -c '%X' $file 2>/dev/null` $file done | sort -n | tail -1 | awk 'BEGIN {CONVFMT="%d"} { days=(systime()-$1)/86400 if (days >= '$MINDAYS') { print "'$rpm'" " " ((systime()-$1)/86400) " days (" $2 ")" } }' done
It runs thusly:
% MINDAYS=14 rpm-usage gnome\* gnome-python2-desktop-2.16.0-1.fc6.x86_64 244 days (/usr/lib64/pkgconfig/gnome-python-desktop-2.0.pc) gnome-python2-extras-2.14.2-9.fc6.x86_64 69 days (/usr/lib64/pkgconfig/gnome-python-extras-2.0.pc) gnome-mime-data-2.4.2-3.1.x86_64 299 days (/usr/lib64/pkgconfig/gnome-mime-data-2.0.pc) gnome-themes-2.16.3-1.fc6.noarch 83 days (/usr/share/icons/HighContrast-SVG/scalable/mimetypes/binary.svg)