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
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...