[PLUG] Using YUM to install RPMs from a text file list

Dwight Hubbard dwight at dwighthubbard.com
Sun Jul 19 17:22:38 UTC 2009


This command will give you a space separated list of all the RPMS
rpm -qa --qf "%{NAME} " > rpmlist.txt

This should pass the list to yum on the command line
sudo "yum install `cat rpmlist.txt`"

However if the list is to long it might exceed the length of a single command 
line, so it might work better to do a simple loop, like this
for line in `cat rpmlist.txt`; do sudo yum install $line; done

On Sunday 19 July 2009 02:23:45 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)
>
> Any help, hints, nudges where to look, etc...
> Thanks!
>
>
>
>
> ----------
> Matt M.
> LinuxKnight
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug

-- 





More information about the PLUG mailing list