On Sun, 2009-07-19 at 02:23 -0700, Matt McKenzie wrote: > In a nutshell I want to do something like this: > > $ sudo yum install < rpmlist.txt > > But that doesn't work, since yum isn't setup to directly take pipes or > redirects from command line. > > Also note the package list has full RPM names, including version, so the > list may need to be trimmed or something to just the package names only. > (Ex... foo-bar-1.2.3-fc11.i586.rpm, and yum probably wants just foo-bar > only)
There is, at this point, no way to strip the version from the package
names. Yum will work with the version, though.
In the future, make your list using this:
$ rpm -qa --queryformat '%{NAME}\n'
The '--queryformat' is a very powerful option. You can also use
'--querytags' to list tags you can use in addition to 'NAME'. There is a
shorter alias '--qf'. For examples, you might want to look
through /usr/lib/rpm/macros.
Back to your original question, in addition to the highly-portable
'xargs', bash supports a nicer form of command substitution with the
construct '$(< file)'. (Look in the bash man page for 'Command
Substitution'.)
$ sudo yum install $(< rpmlist.txt)
You might need to filter out a few special packages, like 'gpg-pubkey',
since those are created by importing GPG public key signatures and not
actually installed as packages.
Wil
--
Wil Cooley <[email protected]>
signature.asc
Description: This is a digitally signed message part
_______________________________________________ PLUG mailing list [email protected] http://lists.pdxlinux.org/mailman/listinfo/plug
