RPM rollbacks?

I really should read man pages. I had no idea that rpm could do rollbacks with just a couple of config changes, and that it was supported in yum.

This would have come in really handy last week. I upgraded an out of date file server and the latest samba broke Directory authentication, which was not cool and file shares cold not be authenticated until the problem was solved. CentOS do not keep old packages in their repos. I had to compile a FC6 version of samba to rollback to a working state until I investigated and found a patch.

The bug is dated May, the patch has been out for months, and the fix is still not in official repos.

Anyway back to rollbacks, 2 steps:

  1. In /etc/yum.conf add the line: 
  2. In /etc/rpm/macos (create it if it does not exist), add the line:
    %_repackage_all_erasures 1

Now if the update or install clobbers something, you can roll back packages to their former state just with a simple rpm command.


rpm -Uhv –rollback ‘9:00 am’,
rpm -Uhv –rollback ‘4 hours ago’,
rpm -Uhv –rollback ‘december 25′.

Leave a Reply

Your email address will not be published. Required fields are marked *