On Mon, 2008-12-15 at 13:18 +1100, Amos Shapira wrote:
> 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

Hello Amos,

As I'm using this script on full updated machines, I didn't really need
the package versions.
Either way, good to hear that it worked.

- Gilboa


=================================================================
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