[CentOS] Re: Linux backup help

Sat Nov 15 21:29:09 UTC 2008
Amos Shapira <amos.shapira at gmail.com>

2008/11/16 Nicolas Thierry-Mieg <Nicolas.Thierry-Mieg at imag.fr>:
>
>
> Amos Shapira wrote:
>>
>> I'll try to try to find or build something based on "rpm -qa" and "yum".
>
> no reason to use yum: it's for resolving dependencies, but in your case they
> would already be resolved.
> Instead you could more simply and reliably wget the files and rpm -U them.

Right, except that this might require to re-implement yum's ability to
find and download the right package from the right repository. Not
sure what's the advantage of wget+rpm over a simple "yum install"
then.

In the meantime, on another list I got the following recipe:

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)

The provider of the above says it works for him on Fedora, CentOS and
RHEL, so it sounds like it's been tested for a while.

I'll test it further before actually using it.

Cheers,

--Amos