Issue
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?
Solution
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
Answered By - Etan Reisner Answer Checked By - Willingham (WPSolving Volunteer)