On Tuesday, November 29, 2011 01:56:59 PM Johnny Hughes wrote:
> rpm -qa > somefile
> 
> rsync somefile to the other machines and then:
> 
> yum install $(cat somefile)
[Note: Johnny's advice is good, and this reply is more addressed to the OP than 
to Johnny, as he already knows what I'm getting ready to post.  The OP may not.]

This will give all the same versions of the packages, which will mostly work, 
unless a version disappears between the 'rpm -qa' and the 'yum install' 
invocations.  I've had that happen before, so in those instances, I use the 
helpful

rpm -qa --queryformat "%{NAME}.%{ARCH}\n" > somefile

line so that I get the names and the arches, but no versions (arch only needed 
if multilib desired, of course).  Newlines are cosmetic, of course, and aren't 
really required by yum install.  To get a listing of all the --queryformat 
variables, use:

rpm --querytags

and see the rpm man page for more information about --queryformat.

I also tend to sort my package names in the pipeline so that somefile is 
human-readable.... and that helps when duplicating the major packages between 
versions (I've used that sequence going from one Fedora version to another, for 
instance).

And a backup of /etc/yum.repos.d along with the gpg keys helps get things in 
order.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Reply via email to