Saturday, February 18, 2012

Simple xargs example

Say I want to install an rpm package with dependencies. Without knowing about the dependencies I would try:

rpm -i foo.rpm

However, I would then get a warning that there are unresolved dependencies.

One solution is to use yum install with xargs. Here is an example:

ls | xargs yum install -y

You may also want to use grep or something similar to have a criteria passed to xargs

No comments:

Post a Comment