How to install exactly the same packages on another computer in openSUSE?

5,173

Solution 1

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.

Solution 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.

Solution 3

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).

Share:
5,173

Related videos on Youtube

greenoldman
Author by

greenoldman

I am interested in such topics: usability and accessibility of user interfaces, design of programming languages, natural language processing, machine translation, data mining. Currently I am developing compiler and programming language Skila -- read more at aboutskila.wordpress.com.

Updated on September 18, 2022

Comments

  • greenoldman
    greenoldman over 1 year

    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

    • Hanan N.
      Hanan N. over 12 years
      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).
    • greenoldman
      greenoldman over 12 years
      @Hanan N., no, that would be easier I know, that's why I made the point about exact versions.
  • greenoldman
    greenoldman over 12 years
    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
    greenoldman over 12 years
    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).
  • n0pe
    n0pe over 12 years
    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.
  • greenoldman
    greenoldman over 12 years
    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