Chris Henry wrote:
On Mon, Dec 1, 2008 at 6:21 PM, Michael Clark <[EMAIL PROTECTED]> wrote:
Cheng Renquan wrote:
On Tue, Dec 2, 2008 at 10:02 AM, Michael Clark <[EMAIL PROTECTED]>
How do I do this with yum?
How about this?
machine a:
rpm -qa > package.list
machine b:
yum install $(<package.list)
[...] I thought of initially but my worry was that the output from rpm -qa
includes the fully qualified package name and version so if the exact
version is not in the repository it might not work (e.g. machine A has not
been updated or is on a different minor release which is the case for me).
Perhaps yum recognizes this and fetch the latest version anyway? [...]
I thought of that method too but my concern will be that `yum install
...` will install all the packages, but not necessarily removed any
packages that are not specified in package.list. Does that matter for
your use? (I might be making wrong assumptions, based on my limited
usage of yum.)
I want to add all the packages but use the latest version in the
repository if one exists. Same as the dpkg --get/--set-selections approach.
Removing i'm not too concerned about (the dpkg approach will only remove
packages if there is a removed but unpurged package on machine A with
retained configuration, packages removed that have been purged are not
listed).
I tried out the rpm -qa method and I get a lot of:
No Match for argument: shared-mime-info-0.15-10
No Match for argument: ttmkfdir-3.0.9-14.1.EL
No Match for argument: perl-XML-LibXML-1.58-1
No Match for argument: arptables_jf-0.0.8-2
No Match for argument: grep-2.5.1-32.2
...
whereas I know these packages should exist (although newer versions).
There is probably some invocation of rpm that does not print the version
(or prints it in another column) - I don't want to bother with a regex .
It is complicated by the fact that the package version may or may not
contain a hyphen itself so I can't just work backwards from the 2nd to
last hyphen.
_______________________________________________
Slugnet mailing list
[email protected]
http://wiki.lugs.org.sg/LugsMailingListFaq
http://www.lugs.org.sg/mailman/listinfo/slugnet