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)

Thanks!

That's exactly where I though that the "Set Complement" operation from
Shlomi's excellent link[0] would come handy:

yum remove $(comm -23 <(sort package_list_new.txt) <(sort package_list.txt))

(for more about the '<(sort ...)' notation see "Process Substitution"
in bash(1))

>
> While I know that there are better ways of doing it (kickstart?) this
> method requires the least effort on my end.

That's what I had in mind but seeing that someone actually have it
working helps a lot to boost my confidence to spend more time to test
this. (have you ever had issues with this approach? How long have you
been using it?)

We use kickstart as part of our automated deployment process but I
don't want to re-deploy the entire system just for a few security or
bug fix updates releases every couple of days.

Cheers,

--Amos

[0]: Set operations in Unix Shell
http://www.catonmat.net/blog/set-operations-in-unix-shell/

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