[Yum] importing and exporting current package list

seth vidal skvidal at phy.duke.edu
Fri Dec 2 05:17:01 UTC 2005


On Thu, 2005-12-01 at 22:12 -0700, Greg Knaddison wrote:
> On 12/2/05, Ian Scott <ian.m.scott at student.manchester.ac.uk> wrote:
> > Is it possible to export a list of installed packages, take that list
> > to a second machine, and then have yum import that list and add and
> > remove packages on the second machine to match the list? Are there any
> > tools, or yum options for doing this?
> >
> 
> There is nothing natively in yum that would do this that I know of,
> but a handful of command line redirects and such and you'd be all set:
> 
> $ yum list installed| awk '{print $1}'
> 
> That gets your list of installed packages.  Then you'd want to check
> on the second machine for duplicates (uniq -c and a grep -v '^2' or
> similar).  Then yum install the packages remaining.
> 
> > I have a set of similar machines, which I plan to install with
> > identical packages. The machines are already setup with FC4, and I
> > have added and removed some packages from the default install on one
> > of the machines. I'd like to replicate that install on the other
> > machines. If there are better ways of solving this problem, please let
> > me know.
> 
> If I know you were doing this from the beginning, I would have said to
> use kickstart to do the install on the other machines.  Maybe it's
> still a reasonable idea.
> 
> >
> > It seems that I can export a list using
> >    yum list installed | cut -d ' ' -f 1
> > No doubt I could write a script that could compare that list with the
> > list on the new machine, and yum install or yum remove the appropriate
> > packages. However, reading this list and other pages, it appears that
> > scripting yum is not recommended.
> >
> 
> I think that "scripting yum" is not supported in terms of creating a
> screen scraper that grabs bits of yum output and then does stuff if
> you want that screen scraper to work over time.  The implication is
> that the output yum creates is not static and that you should expect
> to have to update those "screen scrapers".  However, if you are doing
> this once or twice then sure, go for it.
> 

another idea - for yum 2.4.X - use the shell commands in a file.

see /etc/yum/yum-daily.yum for info
and man yum-shell

-sv





More information about the Yum mailing list