简体   繁体   中英

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?

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.

Use yum .

yum install --exclude='*glob*' *.rpm

From yum --help :

-x [package], --exclude=[package]
                      exclude package(s) by name or glob

使用find获得所需文件的列表,然后使用适当的列表调用rpm。

rpm -ivh `find . -type f \( -iname "*.rpm" ! -iname "exclude.rpm" \)`

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM