Feeding a list of pkgs to yum

Want to make one server like another? Here’s at least the beginning of an answer.

First you need to make a list of packages on the “template” machine (the one you want the other machine to look like).

rpm -qa | grep 'perl-' >pkg-list.txt

rpm -qa | grep 'php' >>pkg-list.txt

You get the idea.

Then copy the list to the other server and run yum with this syntax:

yum install `cat pkg-list.txt`

Pretty neat, eh?

(sorry, just practicing my Canadian English)

This entry was posted in System Administration on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).