2

I work at a place where all of our servers are Debian. Now, one of our customers have their own external server running CentOS 7.

I've gotten the task to put all of our maintenance, update, monitoring, etc. scripts over to this CentOS server. One of those scripts is a very short one. It "backs up" the installed packages by putting the list of installed packages into a file, and thereafter the debconf database to a second file. Script below:

/usr/bin/dpkg --get-selections > /path/to/package.list
/usr/bin/debconf-get-selections > /path/to/debconfdb.backup

I want to figure out the equivalent of these for CentOS. I've only managed to cover the first command.

/usr/bin/rpm -qa > /path/to/package.list

I can't for the life of me figure out what the equivalent of debconf-get-selections (or debconf in general) is on CentOS, and if CentOS even has such a database.

Could someone guide me in the right direction, or blindly tell me the equivalent of the second line?

Christopher
  • 15,611
  • 7
  • 51
  • 64

1 Answers1

2

debconf is used to handle package configuration questions during package installation. In the RPM world, packages aren’t allowed to ask questions during installation, and there is no equivalent to debconf, and no equivalent to debconf-get-selections.

If you want to restore a system’s configuration, you need to save all the system configuration files, typically by backing up /etc (and this remains true on both RPM-based systems and debconf-using systems).

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
  • We do have entire server backups (not yet on this server, but we'll get there). So the answer that was before, which apparently now is deleted, was the closest I could get? – OH MY DEAR PUFFINS Oct 24 '19 at 16:40
  • 2
    My point is that `debconf-get-selections` provides a backup of part of a system’s configuration; to back up a system’s configuration on an RPM-based system, you back up the configuration directly. – Stephen Kitt Oct 24 '19 at 16:45
  • Alright. Thanks a bunch! – OH MY DEAR PUFFINS Oct 24 '19 at 16:48
  • 2
    Side note - RPM-based systems **has** something like debconf. It is rpmconf. But it only handle rpmnew/rpmsave/rpmorig files and does not asks questions like debconf does. – msuchy Nov 08 '19 at 14:07
  • 2
    @msuchy right, but to me that’s the equivalent of `dpkg`’s conffile handling (`.dpkg-dist`, `.dpkg-new` etc.), not the equivalent of `debconf` ;-). – Stephen Kitt Nov 08 '19 at 14:11