1

probably a quick question for experts. on linux(Centso)

I did something like

$ yum list | grep cdh 

which returns a bunch of items(I was search to remove cloudera packages)

I know that I can remove them by

$ yum remove ...

but certainly like to do it in one command. Is there a way to do so? many thanks

currently. I manually output the list result to a text file, and then copy/paste the names into yum remove. there must be a better way. thanks

Etan Reisner
  • 77,877
  • 8
  • 106
  • 148
user3334213
  • 53
  • 1
  • 5
  • possible duplicate of [rpm - erase multiple packages](http://stackoverflow.com/questions/12005526/rpm-erase-multiple-packages) – Etan Reisner Aug 27 '14 at 02:40

2 Answers2

1

yum remove '*cdh*' will do what you want. Though be careful to check the list of packages it wants to remove to make sure the pattern didn't catch too much.

Etan Reisner
  • 77,877
  • 8
  • 106
  • 148
0

You can remove in bulk by using a wildcard.

yum remove 'cdh*'

There is more information here rpm - erase multiple packages

Mudfly
  • 1