How to find the original un-changed configuration file to compare with the *.rpmnew file

configurationdefaultsrpmupdateupgrade

While upgrading from CentOS 5.7 to 5.8 I've received the following warnings:

warning: /etc/sysconfig/iptables-config created as /etc/sysconfig/iptables-config.rpmnew
warning: /etc/ssh/sshd_config created as /etc/ssh/sshd_config.rpmnew
warning: /etc/odbcinst.ini created as /etc/odbcinst.ini.rpmnew

(To know the reason for such files, and what one can do with them read – Why do I have .rpmnew file after an update? )

I want to know what exactly has been change in the default config file by comparing the old default file (the original un-changed configuration file) with the new default file (*.rpmnew). Then, I can apply the changes to my modified file (aka diff merge).

The problem is I don't know where can I find the original un-changed configuration file…

Updated:

So my question is actually:

  1. How to find out what was the previous version of the package?
  2. How to get the file of that version?

Best Answer

the original files should be one without .rpmnew

so for instance, you should have a

/etc/ssh/sshd_config

diff /etc/ssh/sshd_config /etc/ssh/sshd_config.rpmnew

will show you the diff. rpm does this to prevent overriding your settings.

if you are looking for the previously installed rpm, you need to find that rpm, and then extract it with rpm2cpio and then cpio to unpack the files.

then you should be able to find the default configuration files in the unpacked files.