2008/11/16 Amos Shapira <[email protected]>:
> 2008/11/16 Gilboa Davara <[email protected]>:
>> 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 [email protected] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [email protected]

Reply via email to