7

Another computer can be as well virtual machine. I cannot make disk clone because of hardware differences and settings.

I have computer A, installed and running, I also have computer B. I will install the same OS on B, so I would get the same base system.

Then by hand I will add the same repositories as on A.

But the last stage is beyond me -- how to install the same packages as on A? Note, that the version has to match, not only package name.

Of course I am looking for automatic way, not installation manually one by one.

In effect I should get completely different hardware configuration, clean settings (no old passwords, etc), but identical software selection.

Question

How to do it?

Background

The packages (per version) are available but are not the latest ones. The point of this is to make a "copy" of running system, upgrade packages on computer B (copy), test if it works, if yes, then upgrade A. With every new OS version I am hit by many regression bugs, and I have to test it more methodically, than test-live & panic.

openSUSE 11.4

greenoldman
  • 6,176
  • is computer A's packages updated to the latest from the repos? (i am asking that because it can make the answer shorter and your live easier). – Hanan Dec 03 '11 at 16:53
  • @Hanan N., no, that would be easier I know, that's why I made the point about exact versions. – greenoldman Dec 03 '11 at 19:55

3 Answers3

3

Sounds like you have to build your own repository.

Put your RPMs in your desired version into that repository. Then activate these repositories on both machines (as installation source) and install the packages.

Nils
  • 18,492
  • Thank you, I am not marking this as the solution (yet), because maybe someone will come up with another approach -- like, make the list (rpm -qa) and install those very packages in given version on another machine. However your approach scales better (single download per package). – greenoldman Dec 03 '11 at 21:06
2

Seeing as OpenSuse uses RPMs, you can use the rpm utility.

rpm -qa will list all the currently installed packages on your system (a very long list). The list includes package name, version number and architecture. You could write the list to a file and give zypper the file on the new system.

Chances are there will be several packages that are already installed by default, but zypper will skip over them and install the ones you need.

nopcorn
  • 9,559
  • Well, you just copied my comment so we agree in big picture, but the devil is in the details -- how do you force zypper not to install package P, but P-1.23, i.e. with version given? Because this is crucial here (by default the output of rpm is NOT compatible with input format of zypper). – greenoldman Dec 04 '11 at 07:52
  • For the record, I posted this before you posted your comment or you posted it while I was writing my answer. As for zypper, yes you can use the output of rpm -qa as the input for zypper. It understands the format of the package perfectly fine. I haven't tested to see if it obeys version number, but it highly depends on whether or not the repositories hold earlier versions. If the repos don't, then there's not much you can do about it. – nopcorn Dec 04 '11 at 07:59
  • You contradict yourself, "I haven't tested to see if it obeys version number" but "It understands the format of the package perfectly fine". So I clarify -- it does not support the rpm output. In order to specify version you have to add quantifier, and this is a tricky part, because the package naming is just convention, it is not forced by any validator. See: http://en.opensuse.org/SDB:Zypper_usage_11.3#Selecting_packages – greenoldman Dec 04 '11 at 09:39
1

First list all installed packages and their versions in the machine you're trying to create a "clone" of: rpm -qa > /tmp/rpm.list.txt.

Then copy the /tmp/rpm.list.txt to the system you're trying to turn into a "clone" of the another system and run zypper and feed it the package list you just created: zypper install $(cat /tmp/rpm.list.txt) (or wherever you put the file containing the list of packages from the source system).