rpmnew files after a yum update 

Tuesday, July 24, 2007 5:42:38 PM

After doing a yum update, or any form or update using an rpm based tool, you are left with a lot of .rpmnew files hanging around.  These changes are very important to incorporate.  If your like me, I wait so long between server updates (except security based ones) that I may have over 50 of these generated.

You should keep a short list of the configuration files that you must configure by hand, or would cause great harm if they were applied in the blind.

A short list of these are:

/etc/passwd.rpmnew
/etc/group.rpmnew
/etc/modprobe.conf
...

Be sure to remove these files type of .rpmnew files before continuing.

You can find your waiting .rpmnew files:

updatedb
locate rpmnew

Now you should be left will a lot of files, so just to be sure, do a diff of them all, just in case you forgot something.

updatedb
locate rpmnew | while read line; do diff $line ${line%.rpmnew}; done | less

(07/24/2007 update, thanks John :)

locate rpmnew | while read line; do diff -ruN ${line%.rpmnew} $line; done | less

Once you have carefully evaluated the output of the above and either merged the files or decided the new file is a good thing.

WARNING! This next step could disable your computer and make it so you can't restart or log back in!  Be sure you know what your doing.

To move the remaining files over the current files:

updatedb
locate rpmnew | while read line; do mv -f $line ${line%.rpmnew}; done

This all seemed to work on my CentOS 5.0 and 4.0 systems.


On my Gentoo systems, all I do is execute etc-update.



Comments are closed on this post.