Removing duplicate RPMS.

2010-05-12 91 words 1 min read

Got the script mainly with google search on the <a href="">link.

Nice trick..

Get the list of rpms with just the names
rpm -qa –queryformat &#8217;%{name}\n&#8217; > pkglist

Get the non-uniques list.
sort -g pkglist | uniq -d > duplicates

Get the versions of the duplicate files:
for pkg in `cat duplicates`; do
rpm -q $pkg » removelist

Now keep the rpms that you want to delete in the removelist

and a simple command to remove them will be :
for pkg in `cat removelist`; do
rpm -e $pkg

Tags: Linux rpms


Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it