Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

share|improve this question
    
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 N. Dec 3 '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 3 '11 at 19:55

2 Answers 2

up vote 2 down vote accepted

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.

share|improve this answer
    
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 3 '11 at 21:06

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.

share|improve this answer
    
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 4 '11 at 7: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. –  maxmackie Dec 4 '11 at 7: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: en.opensuse.org/SDB:Zypper_usage_11.3#Selecting_packages –  greenoldman Dec 4 '11 at 9:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.