22

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

Braiam
  • 35,991
  • just a side note in case you don't know it already: you can get the list of programs to install on the new system, then copy over the settings in your home folder (files and directories whose names start with a .) – phunehehe Aug 11 '10 at 06:25
  • Just be careful about version mismatches. I've wrecked settings due to configuration incompatibilities in my home directory doing that. Typically it works ok migrating to newer versions, but there are occasional difficulties. – Matt Simmons Aug 11 '10 at 10:17

4 Answers4

19

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)
yanjost
  • 103
8

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.

Ura
  • 534
  • Fedora is a distribution on its own terms, with an aggressive stance of being the first with the best of open source/free software. Red Hat Enterprise Linux is a very conservative distribution, almost the dimetral oposite. Red Hat takes (selected packages of) a version of Fedora and after stabilization and QA cuts Red Hat Enterprise Linux from it. To call Fedora "an R&D project" is as wrong as saying that Debian does R&D for Fedora (yes, Fedora does take patches and even complete packages from Debian, and viceversa). – vonbrand Mar 15 '13 at 14:40
2

You can try Kickstart or you may want to set up a PXE install/boot server for multiple distros. Or if some of your machines are diskless you can try LTPS method (this is what is generally called - thin client - IIRC), also see here

EDIT: If that's the case see this

drs
  • 5,453
  • 1
    I think the question was more asking how to get a list of installed apps on one box/distro and install them on another box/distro, rather than an automated way of doing installs. – Frozenskys Aug 10 '10 at 21:22
  • The latter is correct, and was exactly what I needed. – Wesley Burr Aug 10 '10 at 22:06
0

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 rpm:

yum list installed | xargs -n3 | column -t | grep -v "@" | tail -n +3 |cut -d' ' -f1

To get the list of package installed from yum:

yum list installed | xargs -n3 | column -t | grep "@" | tail -n +3 |cut -d' ' -f1
mach6
  • 111
  • While this is — I guess? — a useful adjunct to Dejan's answer to this question, it is not an answer to this question.  Perhaps you could write a question that corresponds to the above post, and then submit (i.e., ask) that as a new question.  Also, answers like this should explain what they are doing (and how) and show example output. – G-Man Says 'Reinstate Monica' Apr 11 '19 at 22:13