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

drew wymore drew.wymore at gmail.com
Sun Jul 19 09:51:06 UTC 2009


On Sun, Jul 19, 2009 at 2:44 AM, Matt McKenzie <lnxknight at gmail.com> wrote:

> On Sun, Jul 19, 2009 at 2:29 AM, drew wymore <drew.wymore at gmail.com>
> wrote:
>
> > On Sun, Jul 19, 2009 at 2:23 AM, Matt McKenzie <lnxknight at gmail.com>
> > wrote:
> >
> > > So, I have Fedora 11 running in a VirtualBox VM.
> > > I had it setup earlier, but somehow screwed it up and decided to just
> > wipe
> > > it and start over (its only a VM anyway).
> > > Before I did, I created a list of installed RPMs (after installing many
> > > from
> > > regular repos and RPMFusion), so I wouldn't have to go through manually
> > and
> > > reinstall them.
> > >
> > > So I have a file generated by
> > > $ rpm -qa > rpmlist.txt
> > >
> > > So far I can't seem to find a way to have yum fetch and install the
> RPMs
> > > listed in a text file.
> > >
> > > My google fu so far hasn't come up with anything, but perhaps there is
> > some
> > > better way of wording it...
> > > hopefully someone else has run into something like this.  Funny how I
> > > haven't yet, though I have used Fedora since FC1, and RedHat 5-9 before
> > > that
> > > (as in the old RedHat Linux, not RHEL)
> > >
> > > 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
> > >
> >
> >
> > I haven't tried this yet Matt as I just installed Fedora last night but
> you
> > might try this.
> >
> > cat rpmlist.txt |xargs
> >
> > then copy the list and export it to a variable like RPMLIST
> >
> > for i in $RPMLIST; do yum install $i; done
> >
> > HTH,
> > Drew-
> > _______________
> >
>
>
> Drew,
>
> I don't think I would want to spawn a new yum process for each line though.
> Yum isn't just the installer, that is what the "rpm" command is for (though
> rpm only works locally).
> Yum also fetches something if you don't have it, and it resolves
> dependencies.
> Thus I don't know if having it run on each line is a good way to do it.
>
> I want to feed it the list of files, and have it run the whole list, and
> download and install them all.
>
> Maybe this method would work, but on first glance anyway it seems like it
> would cause a massive system load trying to run yum for each line (there
> are
> many many lines, not just a few or a dozen, but several hundred or more).
>
> If you just give it a bunch of package names on the command line, it will
> check to see if they are already installed, and if not, fetch and install
> them.
>
> Ex:
>
> $ yum install foo bar baz xyzzy
>
> Will check and install all four packages (foo bar baz xyzzy).
>
> So now I have a huge list of packages in a text file, and want it to do
> similar thing, without having to just copy and paste the huge list onto a
> command line.  It sounds like it should be doable....
>
>
> ----------
> Matt M.
> LinuxKnight
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>

Good point Matt. I'm coming from using Slackware so admittedly I'm not used
to yum quite yet. Although exporting the list to a variable and just feeding
the variable name might work? so yum -y $RPMLIST  .. I'm installing KDE
right now otherwise I'd test this before just tossing it out there but it's
an idea at least.



More information about the PLUG mailing list