[CentOS] Down-grading to an "obsoleted" package

Fri Aug 15 18:21:42 UTC 2014
Thomas Eriksson <thomas.eriksson at slac.stanford.edu>


On 08/15/2014 07:45 AM, Toralf Lund wrote:
> Hi,
> 
> Does anyone know if there is a clean way to "downgrade" to the old rpm 
> package when it was previously replaced by another that obsolete it?
> 
> I mean, say that I have installed some rpm "A-1.0-1.x86_64.rpm", and 
> along comes "B-1.0-1.x86_64.rpm", whose spec has
> 
> Obsoletes: A
> 
> Now, if I do "rpm -U B-1.0-1.x86_64.rpm" or "yum install 
> B-1.0-1.x86_64.rpm" or (if B is available through an enabled repository) 
> "yum update", what happens is that "A" gets removed and "B" is installed 
> in its place. Then I decide I want to switch back to "A". So what do I 
> do? I know that one answer is
> 
> rpm -e B
> rpm -U A-1.0-1.x86_64.rpm
> 
> - but what if A and B provide facilities required by other installed 
> packages? I'll then have to pass "--nodeps" when removing B, but that's 
> something that I really want to avoid as it means loosing control over 
> whether all dependencies are satisfied. So is there an alternative?
> 
> "rpm -U A-1.0-1.x86_64.rpm" alone seems to fail with file conflicts, 
> assuming "B" replaces some of "A"'s files. In a real scenario I tried, 
> there was no mention of the fact that something that was essentially a 
> newer version of the same package, was already installed.
> 
> "yum upgrade A" (when the package is available on a repository) fails in 
> a similar manner.
> 
> "yum localinstall A-1.0-1.x86_64.rpm" is a bit smarter - it exists with 
> a message like "Cannot install package A. It is obsoleted by installed 
> package B".
> 
> "yum downgrade A" (via repository) says something like "No Match for 
> available package: A-1.0-1.x86_64.rpm".
> 
> "yum localdowngrade A-1.0-1.x86_64.rpm" would seem to have the highest 
> probability of success based on the above, except that there is no such 
> command :-/
> 
> Any other ideas?
> 
> - Toralf
> 

You can try using 'yum shell'

# yum shell
> remove B
> install A
> run


	Thomas