How do I install the same RPM packages on a new server as an old?

First you need a list of the packages on the old server.

rpm -qa --qf "%{NAME}\n" > rpmlist.txt

 

Copy this file to the new server (for example using SSH).

 

To bulk install all of the packages installed on the old server

yum install `cat rpmlist.txt|tr '\n' ' '`

 

You should then be prompted to install all packages missing on the new server.

You cannot comment on this entry