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

What's the best (ie foolproof and easy) mechanism for rolling back an rpm update using YUM?

I've not come across the problem where I upgrade something and later find I want to downgrade it, but I'd rather be prepared for when it does happen.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

This appears to be a fairly easy to follow procedure for doing it: Yum Rollback

It does involve making some configuration changes to yum, but seems pretty easy. To summarize the link:

  1. Add ‘tsflags=repackage’ to /etc/yum.conf
  2. Add ‘%_repackage_all_erasures 1’ to /etc/rpm/macros

And when you want to rollback use the ‘--rollback’ flag within rpm. Like I said, seems pretty brain dead easy.

share|improve this answer
    
now that really does look like the business. Why isn't that on by default?! –  gbjbaanb May 31 '09 at 14:48
    
it's not by default because you have to have the old package for rpm or it won't work - rpms don't really "upgrade" or "patch", they reinstall with the new edition –  warren Oct 4 '09 at 11:33
    
This works on my CentOs but not on FC, do you know why ? I got a "--rollback: unknown option" –  Bastien974 Sep 28 '11 at 14:43
1  
@Bastien974: It looks like rollback was removed with rpm-4.6.0 per rpm.org/wiki/Releases/4.6.0#Removedfeatures You're probably using CentOS 5, which uses rpm-4.4.2. Most likely you're using a release of Fedora that includes rpm-4.6 or higher. (Note that F15 is at v4.9.1) –  Scott Pack Sep 28 '11 at 15:33
add comment

Just use the --oldpackage switch with the older rpm:

rpm -Uvh foo.rpm --oldpackage
share|improve this answer
add comment

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.