Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I force yum install even if it's a downgrade? [closed]

So the scenario is as follows: I have some systems that I download builds for from our CI server and install them. These builds are un-released builds, but the naming convention has a timestamp in it to determine newer builds. So I install one of these builds, test it, great.

Well, at some point I want to revert back to our actual released builds which are on our local yum repo. But if I did yum install -y somepackage, install is going to say that the version its trying to download is obsoleted by this unreleased version I've installed.

What I'm wondering is if there's a way to force yum to install the build even if its obsoleted by the currently installed one, or am I going to be forced to yum remove the installed build before yum installing the released build?

I don't mind doing the latter, but the former is a better solution because some high availability components that depend on this RPM complain when it goes missing, so I'm wondering if it's possible.

Thanks ahead of time!

like image 913
Eddie Rivas Avatar asked May 27 '16 19:05

Eddie Rivas


2 Answers

Yes, you can install an older available version (of an already installed package) with the downgrade sub-command:

yum -y downgrade mypackage-1.2.3-4

Note that you have to explicitly specify the version/release of the package you want to downgrade to.

This command is also available with dnf, the yum successor.

like image 182
maxschlepzig Avatar answered Sep 23 '22 10:09

maxschlepzig


yum downgrade somepackage

Also, commands under yum history may be of help to you in similar situations.

like image 40
user7610 Avatar answered Sep 23 '22 10:09

user7610