Re: finding orphaned files

[email protected] Fri, 25 Jul 2008 14:36:03 -0500
Newsgroups gmane.linux.redhat.rpm.general
Message-ID <OF4E51E1E4.54162F5C-ON86257491.006B86A5-86257491.006BAB6A@uscmail.uscourts.gov>
> This simple script give you which rpm own which dir.
>
> _t_d=$(mktemp -d -p /tmp)
> _f_f=$(mktemp -p ${_t_d} XXXXXXX)
> for _pkg in $(rpm -qa --qf '%{name}-%{version}\n' | sort | uniq)
> do
>  rpm -q --qf '%{name} owns %{dirnames}\n' ${_pkg} | uniq >> ${_f_f}
> done
> echo "wrote ${_f_f}"

thanks... I'm still not sure I found exactly what I was looking for but I'm
close enough at this point.

> FYI, rpm5 have implicit dependency on parent dir o filelinkto (so it
> is no possible to have orphan dir for example: this resolve many
> problem on package removal or upgrade). IMHO, Orphan file aren't an
> issue, IMHO, if they live in /var or  in a volatile filesystem .

as far as I know we have no plans to goto a different version of RPM than
that provided with RHEL, but that is good to know.  Its a nice addition.


-greg