The Blog Thing

Hints, tips and thoughts about IT, security and privacy

How to roll back packages on CentOS 5 / RHEL 5

with one comment

CentOS 5 / RHEL 5 preferably uses yum as the program to update, install and remove packages.
When you’ve installed/updates packages with yum or rpm, you can quite easily roll back the updates/installations using rpm.
For this, yum and rpm need to save roll back information, which they do not do by default.
To enable the roll back feature, do the following:

Add tsflags=repackage to /etc/yum.conf.
Add %_repackage_all_erasures 1 to /etc/rpm/macros. If /etc/rpm/macros does not exist, just create it.

You can now install, erase and update packages with yum and/or rpm, and they will save roll back information.

When you want to roll back, use rpm to do so.
You do this by specifying the --rollback switch and a date/time, like the examples below:

rpm -Uhv --rollback '19:00'
rpm -Uhv --rollback '8 hours ago'
rpm -Uhv --rollback 'december 31'
rpm -Uhv --rollback 'yesterday'

Happy rolling :)

Written by Vincent Verhagen

December 10th, 2007 at 10:35 UTC

Posted in Uncategorized

Tagged with

One Response to 'How to roll back packages on CentOS 5 / RHEL 5'

Subscribe to comments with RSS or TrackBack to 'How to roll back packages on CentOS 5 / RHEL 5'.

Leave a Reply

You must be logged in to post a comment.