Removing duplicate RPMS.
2010-05-12
91 words
1 min read
Got the script mainly with google search on the <a href="http://linux.derkeiler.com/Mailing-Lists/Fedora/2006-12/msg04156.html">link.
Nice trick..
Get the list of rpms with just the names
rpm -qa –queryformat ’%{name}\n’ > 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
done
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
done
Related Articles:
- 2010/01/16 View information on all the rpms installed.
- 2010/05/12 vi – the powerful Linux/Unix text editor
- 2010/05/11 Firefox 4.0 mockups for LInux/Windows and Mac
- 2010/05/06 75% of Linux code now written by paid developers
- 2010/05/03 Linux Contractor Fired for Using Firefox/Linux
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.