Compare 2 Servers RPM and Install RPM from Text File List

1. Generate RPM list on Old Server

rpm -qa --queryformat='%{NAME}\n' | sort > serverold.txt

2. Generate RPM list on New Server

rpm -qa --queryformat='%{NAME}\n' | sort > servernew.txt

3. Copy File to New Server and use diff comand to get differences

diff serverold.txt servernew.txt > diff.txt

4. Get list of packages missing in new Server

cat diff.txt | grep "<" > difference.txt
vi difference.txt
%s,< ,
## save and exit

5. Install missing packages on new server

yum -y install $(cat difference.txt)

 

Category: LinuxLinuxUncategorizedUnix

Tags:

Leave a Reply

Article by: Shadab Mohammad