tip: automated way to delete duplicate rpms

Jacques B. jjrboucher at gmail.com
Sat Dec 30 12:59:31 UTC 2006


> I created a small script file called dupWithVersions with this in it
>
> for pkg in `cat duplicates`; do
>   rpm -q $pkg
> done
>
> Redirect the output to another file like this.  $dupWithVersions
> >removeList

Great tip!  Might I add something.  Once you have a list of unique
files (unedited - full list of unique files) run a for loop using
those files for input (as above) but do a grep against the original
list of rpms, using the count option.  Then with a simple "if"
command, if the count is greater than 1, remove it.  Continue the for
loop.

That way the script automatically determines if there is more than one
version of an rpm installed and removes it.

Jacques B.




More information about the fedora-list mailing list