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:
- In /etc/yum.conf add the line:
- In /etc/rpm/macos (create it if it does not exist), add the line:
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′.