2008/11/16 Amos Shapira <amos.shap...@gmail.com>:
> 2008/11/16 Gilboa Davara <gilb...@gmail.com>:
>> I usually do the following: (Under both Fedora, CentOS and RHEL)
>>
>> A. Installing the missing packages.
>> (On the source machine:)
>> $ rpm -qa --queryformat="%{NAME}-%{ARCH}\n" | sort > package_list.txt
>> (On the target machine:)
>> $ yum install -y $(cay package_list.txt)
>>
>> B. Remove "extra" packages:
>> (On the target machine:)
>> $ rpm -qa --queryformat="%{NAME}-%{ARCH}\n" | sort > package_list_new.txt
>> $ yum remove $(diff package_list_new.txt package_list.txt | grep ">" | cut 
>> -d">" -f2)

BTW - I just got around to actually use this sequence in a slightly
different context and noticed that I missed the most important part -
exact release and version number.

Correct format to produce a list for yum:

rpm -qa --queryformat="%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n"

This allows me to upgrade our staging env to latest version, test it,
then replicate exact versions in production.

Cheers,

--Amos

=================================================================
To unsubscribe, send mail to linux-il-requ...@cs.huji.ac.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-requ...@cs.huji.ac.il

Reply via email to