CentOS6 - Backup all RPMs and installed programs

166 views Asked by At

Is there away to backup all installed applications/RPMs/packages/ (even repositories) as is (with same exact versions/patches) on 1 script that can re-install them on a fresh bare bone server of the same specs

Note: I can't do any image or CloneZilla tricks
Note: there are some 3rd party software that is not offered by any repos ... solution should contain a backup of these packages (preferably all)

thanks!

1

There are 1 answers

0
Thomas Dickey On

As noted in a comment, you can backup the RPM database, but that is only one part of replicating your configuration to another server:

  • RPM's database records almost all of the information regarding the packages you have installed. Using the database, you could in principle do something like a script that used cpio or pax to append all of the files known to the RPM database to a suitably large archive area. rpm -qa gives a list of packages, and rpm -qlpackage gives a list of files for the given package.
  • However, RPM's database does not necessarily record files created by package %pre and %post scripts.
  • Likewise, it does not record working data (such as a MySQL database) that may be in /var/lib.

To handle those last two cases, you are going to have to do some analysis of your system to ensure that you do not leave something behind. rpm -qfpathname can tell you who owns a given file- or directory. What you have to do is to check for cases where RPM does not know who owns it.