Given an installation based on Yum (specifically in my case, a Scientific Linux 5.1 x86_64 installation), how would I duplicate the installed programs and utilities to a new machine based on Fedora Core x86_64? The hardware is very similar but not identical, and there's the obvious difference that SL5 is based on EL, not on Fedora; I'm largely aiming to duplicate the user experience from the original box (SL) to the new box (FC).
You can create a list of the installed software with:
$ rpm -qa > installed-software.log
Since they are based on different distros, I am not sure how you would do the install.
If I was copying it to a fresh install of the same distro, I would run the following command as root
# yum -y install $(cat /home/user/installed-software.log)
Get list of installed RPMs on your RHEL box:
yum list installed |tail -n +3|cut -d' ' -f1 > installed_packages.txt
Install packages onto Fedora:
yum -y install $(cat installed_packages.txt)
Note: Fedora is the R&D project for RHEL and you should be able to install most of these packages in Fedora.
Steves method lists version numbers and you want to avoid that.
I believe Dejan's answer https://unix.stackexchange.com/a/25729/346788 is the best one for
yum based system. However, it may not work when you ssh into the server due to the buffer. Details at How to get `yum list` output to stay on one line when getting output via remote ssh command?
Thus, to slightly improve, to get the full list of package:
yum list installed | xargs -n3 | column -t | tail -n +3 |cut -d' ' -f1
To get the list of package installed from a
yum list installed | xargs -n3 | column -t | grep -v "@" | tail -n +3 |cut -d' ' -f1
To get the list of package installed from
yum list installed | xargs -n3 | column -t | grep "@" | tail -n +3 |cut -d' ' -f1