13 May 2008

Install the same packages between two GNU/Linux installation, using yum

There is some cases where it is interesting to ensure having the same installed packages between two GNU/Linux installation.
Those installations must be of same architecture and be as near as possible (ideally the same version), otherwise it is obvious it won't work. In addition, it is needed to have the same rpm packages sources (for instance the same repositories if using yum).
For instance, it gives the ability to create a virtual machine with almost the same configuration, and then to perform lots of "tests" (upgradibility ...) without risk (but the one to get a "dead virtual machine") before performing the same instructions on the "original" installation.
Personally, I've used this ability to test upgradibility between Fedora 8 and Fedora 9.
To get the list of installed packages of an installation (including the architecture, which is particularly important there):
rpm -qa --qf "%{NAME}.%{ARCH} " > /tmp/allPackagesList

Then copy the file to the other installation.

Finally, use yum (or something else), to install all those packages (for instance, under GNU/Bash):
yum install $( cat /tmp/allPackagesList )

Such a way, all the packages installed on the first installation, will be installed on the other one.
Nevertheless, there may be other packages already installed on the second one, so the installed packages would not be exactly the same.
I'll write another post to explain how to remove such packages.

No comments:

Post a Comment

Thank you for your visit, let's share your point of view: