YUM Downgrade Packages on Fedora, CentOS, Red Hat (RHEL)

This is quick tip, howto downgrade packages using YUM (example) on Fedora, CentOS, Red Hat (RHEL). This works simply with yum downgrade command and is very usefull when package(s) downgrade is needed some reason.

YUM Downgrade Basic Usage

Downgrade is very straightforward when package have not any dependencies, which affect the downgrade.

YUM Downgrade Single Package

yum downgrade package
Example:
yum downgrade hunspell-mr.noarch
 
Setting up Downgrade Process
Resolving Dependencies
--> Running transaction check
---> Package hunspell-mr.noarch 0:20060920-5.fc13 set to be downgraded
---> Package hunspell-mr.noarch 0:20060920-6.fc14 set to be erased
--> Finished Dependency Resolution
 
Dependencies Resolved
 
================================================================================
 Package            Arch          Version                   Repository     Size
================================================================================
Downgrading:
 hunspell-mr        noarch        20060920-5.fc13           fedora         62 k
 
Transaction Summary
================================================================================
Downgrade     1 Package(s)
 
Total download size: 62 k
Is this ok [y/N]: y
Downloading Packages:
hunspell-mr-20060920-5.fc13.noarch.rpm                   |  62 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : hunspell-mr-20060920-5.fc13.noarch                       1/2 
  Cleanup        : hunspell-mr-20060920-6.fc14.noarch                       2/2 
 
Removed:
  hunspell-mr.noarch 0:20060920-6.fc14                                          
 
Installed:
  hunspell-mr.noarch 0:20060920-5.fc13                                          
 
Complete!

YUM Downgrade Package Which Have Dependencies

YUM downgrade is more difficult with packages that have dependencies. YUM downgrade does not resolve dependencies automatically, so it must be done manually.

YUM Downgrade Package and Dependencies

yum downgrade lib1 lib2 package
Example: check package dependencies manually
yum downgrade sqlite
 
Setting up Downgrade Process
Resolving Dependencies
--> Running transaction check
---> Package sqlite.i686 0:3.6.22-1.fc13 set to be downgraded
---> Package sqlite.i686 0:3.6.23-1.fc14 set to be erased
--> Finished Dependency Resolution
Error: Package: sqlite-devel-3.6.23-1.fc14.i686 (@rawhide/12)
           Requires: sqlite = 3.6.23-1.fc14
           Removing: sqlite-3.6.23-1.fc14.i686 (@rawhide/12)
               sqlite = 3.6.23-1.fc14
           Downgraded By: sqlite-3.6.22-1.fc13.i686 (fedora)
               sqlite = 3.6.22-1.fc13
 You could try using --skip-broken to work around the problem
SQLite package depends on sqlite-devel package, so both (sqlite-devel and sqlite) have to be downgraded:
yum downgrade sqlite-devel sqlite
 
Setting up Downgrade Process
Resolving Dependencies
--> Running transaction check
---> Package sqlite.i686 0:3.6.22-1.fc13 set to be downgraded
---> Package sqlite.i686 0:3.6.23-1.fc14 set to be erased
---> Package sqlite-devel.i686 0:3.6.22-1.fc13 set to be downgraded
---> Package sqlite-devel.i686 0:3.6.23-1.fc14 set to be erased
--> Finished Dependency Resolution
 
Dependencies Resolved
 
================================================================================
 Package              Arch         Version                 Repository      Size
================================================================================
Downgrading:
 sqlite               i686         3.6.22-1.fc13           fedora         309 k
 sqlite-devel         i686         3.6.22-1.fc13           fedora          80 k
 
Transaction Summary
================================================================================
Downgrade     2 Package(s)
 
Total download size: 389 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): sqlite-3.6.22-1.fc13.i686.rpm                     | 309 kB     00:00     
(2/2): sqlite-devel-3.6.22-1.fc13.i686.rpm               |  80 kB     00:00     
--------------------------------------------------------------------------------
Total                                           438 kB/s | 389 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : sqlite-3.6.22-1.fc13.i686                                1/4 
  Installing     : sqlite-devel-3.6.22-1.fc13.i686                          2/4 
  Cleanup        : sqlite-devel-3.6.23-1.fc14.i686                          3/4 
  Cleanup        : sqlite-3.6.23-1.fc14.i686                                4/4 
 
Removed:
  sqlite.i686 0:3.6.23-1.fc14         sqlite-devel.i686 0:3.6.23-1.fc14        
 
Installed:
  sqlite.i686 0:3.6.22-1.fc13         sqlite-devel.i686 0:3.6.22-1.fc13        
 
Complete!
Follow If Not True Then False Updates!

11 Comments

  1. Hello, i downgraded one of my packages… and can’t upgrade it back to what it was. Any solution to this? yum update/upgrade does not work
    thx for help

    • Hi Grzegorz,

      Could you post more info about error what you get, when you try to update it?

      • Sorry to make fuss… i solved problem. I had new package with verion 5.2 and downgraded it to 5.1. Couldnt upgrade to 5.2 anymore since 5.2 got considered as “too buggy” and was removed from centos repositories. (php-tidy package).
        So it seems its fine now. But maybe a warning for others who accidently downgrade and can’t upgrade.
        Thank you for your interest in the matter

        • No problem at all :) Glad to hear that you got it to work.

  2. Is there a way to downgrade to a specific version of the package?

    • Hi Vadim,

      Yes it should be possible, if this specific package (and dependencies) still found from repo. Do you have some example case which package you want downgrade?

  3. how to downgrade existing RHEL 5.9 to RHEL 5.8

    • Hi venkata,

      Check /var/log/yum.log and find upgraded packages and try to downgrade those. Btw. do you have some reason why you want to downgrade?

  4. Hi JR, I know this is not exactly the subject, but I would like to ask you for help: I installed Fedora 17(via CD) over Fedora 14. I made the mistake of not backing up info. Then I had to use Photorec to recover the photos I had. But my wife had some other info she would like to have again. My question is: is there a way to make like a rollback of the operative system? Would it help to get my old info back? Thanks a lot for your reply

    • Hi sema,

      This depends on, how you installed Fedora 17? Did you used clean install or upgrade?

      If you cleaned all disks, then it might be almost impossible to get your data back. It’s possible that your data is still on your disk, but you might need some data recovery professional help to get your data back.

      • Yes, clean installation :-/ Could you advise a good professional help?

Leave a Comment

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>