I have a directory full of RPM files recently installed (gotten by running yum install --downloadonly prior to the install).
I want to know remove all these RPMs to get close to a 'fresh' install for testing reasons.
Is there an easy way to uninstall all RPMs listed in the directory at once?
I tried this:
find . *.rpm | sed "s/.rpm$//g" | xargs sudo yum remove
but I get the message "no match for arguments ./" for each rpm in the list, so something is wrong with the command.
find .... | munge | xargs rm
: you want to make sure that the first part produces exactly what you expect or you'd be deleting files you want to keep. – NickD Jun 2 '17 at 20:16find . -name '*.rpm'
to restrict it to just files with .rpm suffix in this directory and all subdirs. If you don't have subdirs, thenls *.rpm
in the place of find would suffice. – NickD Jun 2 '17 at 20:24