Erase multiple packages using rpm or yum

后端 未结 5 983
故里飘歌
故里飘歌 2021-02-01 23:17

I was given access to a server with 50+ php rpms installed. I\'m trying to remove them all.

Basically, I\'m trying to combine these two commands:

rpm -qa         


        
5条回答
  •  一整个雨季
    2021-02-01 23:49

    Another option is to use the output of rpm -qa | grep ... in the rpm --erase command directly:

    rpm --erase `rpm -qa | grep php`
    

    Maybe not for the php case you're citing, but the xargs approach might possibly run into issues if it decides to split the list into several invocations of rpm -e and the first list contains packages that are dependencies of packages in subsequent lists. Of course, if you're removing that many packages all at once, you might have other things that you need to consider...

提交回复
热议问题