Clone installed packages between different CentOS versions.
May 4th, 2013 by Andrea Matesi
Intro.
- Say you have an old crufty CentOS host that you cannot absolutely touch because it is workingtm (apart from the occasional apache-OOM, that is).
- Say you are required to migrate this old system to a new hardware (perhaps to a VM), and, for the occasion, to a more recent CentOS version.
Fortunately with Linux, you have plenty of options!
One of them could be by manually cloning the old CentOS configuation to the new one (essentially by trying to replicate the existing setup on the new system).
But how to clone the installed programs list to the new one? It can be done!
On the Old CentOS host:
Launch (on the old system):
rpm -qa --queryformat “%{NAME}\n” > yum.packages.list
This command will export the list of the applications installed on the old CentOS without the architecture extension, version number, revision, etc. (ie: "gnome-utils-libs" vs "gnome-utils-libs-2.28.3-1.fc11.i586").
Much better, but the real advantage of the previous command is that it will create a list of packages compatible to yum (ie.: this packages list could be directly supplied to the yum command)!
On the New CentOS host.
This way you could:
yum -y install < yum-packages.list
And yum will simply fetch and install the latest versions of the packages specified on the list file directly from its repos. Please note that, before launching the previous command, I'd recommend you to at least check the repos (on both systems).
Now you can focus on the serious stuff: the /etc folder and the configuration files. Good luck!
SRC:
http://www.cyberciti.biz/tips/linux-get-list-installed-software-reinstallation-restore.html
Posted in LINUX, System Administration | No Comments »









