Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?
share|improve this question
    
It actually says exactly where the original and where the rpmnew files are, right in the warning message: "warning: /etc/ssh/sshd_config created as /etc/ssh/sshd_config.rpmnew" –  cjc Mar 22 '12 at 17:20
    
@cjc I'm not that fool :) please see updated question –  User Mar 22 '12 at 18:36
1  
Ah. Look for the final versions of the 5.7 packages from vault.centos.org, specifically vault.centos.org/5.7/os/i386/CentOS and then use the rpm2cpio tool to extract the ones you want to look at, as per johnshen64's answer. Also look in vault.centos.org/5.7/updates for updates to any packages in the 5.7 base. –  cjc Mar 22 '12 at 19:06

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
1  
I could be wrong but as far as I understand, the OP has modified the original configuration files, so the files on his system (e.g. sshd_config) is modified. The OP is asking how to find the original unmodified ones –  dvb Mar 22 '12 at 17:39
    
Ah, you are talking about unmodified configuration file of the previously installed rpm? In that case, we have to find the original rpm and extract. This would depend which exact version was installed before the new rpm version was installed. rpms are just archives that can unpacked to find the individual files. rpm2cpio is the usual tool for that. –  johnshen64 Mar 22 '12 at 17:43
    
Yeah dvb is right, that what I'm talking about, I would be grateful if you could edit your answer to explain how to find out what was the previous version and how to get the file of that version –  User Mar 22 '12 at 18:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.