Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what happens on yum downgrade?

Tags:

rpm

yum

When yum downgrade is run on an installed package, does yum first delete the package and then re-install the previous package? As a corollary, what argument is passed to the %preun scriptlet of the package on yum downgrade, 0 or 1?

like image 668
Chris Card Avatar asked Jan 20 '26 13:01

Chris Card


1 Answers

Good question. From a quick skim of the yum 3.2.22 sources (from my CentOS 5 machine) it looks like it is a single transaction that is remove + install. Which would make me think %preun would get 1 passed to it.

The built-in help for yum.YumBase.downgrade also has this to say:

$ python
Python 2.4.3 (#1, Jan  9 2013, 06:47:03)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import yum
>>> help(yum.YumBase.downgrade)
Help on method downgrade in module yum:

downgrade(self, po=None, **kwargs) unbound yum.YumBase method
    Try to downgrade a package. Works like:
    % yum shell <<EOL
    remove  abcd
    install abcd-<old-version>
    run
    EOL
like image 110
Etan Reisner Avatar answered Jan 22 '26 08:01

Etan Reisner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!