Search code examples
linuxwildcardrpm

how to make rpm -ivh *.rpm ignore a specific rpm


I have to do rpm -ivh *.rpm under a directory with lots of rpms. I want to ignore one or two specific rpms. How can I do that?


Solution

  • If they don't have spaces or newlines in the filenames (which is what I'd expect, for rpms), then the easiest route would be

    rpm -ivh $(ls *.rpm | grep -v firstbadone | grep -v secondbadone | ...)
    

    This will go wrong with spaces, though, so be careful.