How can I get a list of files on my computer that are not "owned" by any package?
find /usr/lib -type f -exec dpkg -S {} + 2>&1 >/dev/null | sed -r 's/^[^/]+//'
I'll warn you now: it's slow.
You can run the following command
join -t '' -v1 <(find /usr/lib | sort) \
<(grep -h /usr/lib /var/lib/dpkg/info/*.list | sort -u)
that compare the list of files in /usr/lib
with the list of files present in at least a file in /var/lib/dpkg/info/<NAME>.list
(the files used by dpkg -S
). The -v1
option would report files present in the first list but not in the second one.
On my machine this difference list gives more than 5000 hits, so I doubt it could be of any help.
sudo aptitude install cruft
man cruft
sudo addgroup cruft
sudo chmod g+rwx /var/spool/cruft
sudo chown root:cruft /var/spool/cruft
sudo addgroup $USER cruft
cruft -r cruftreport
sudo chown root:root /var/spool/cruft
less cruftreport