10

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!

Eddie Rivas
  • 335
  • 1
  • 3
  • 11
  • 2
    Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. Also see [Where do I post questions about Dev Ops?](http://meta.stackexchange.com/q/134306) – jww Feb 22 '17 at 09:02
  • @jww thanks for the heads up, I didn't know SO had branched out the infrastructure and ops pieces out into their own pages. – Eddie Rivas Mar 28 '17 at 19:17

5 Answers5

8

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.

maxschlepzig
  • 35,645
  • 14
  • 145
  • 182
5
yum downgrade somepackage

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

user7610
  • 25,267
  • 15
  • 124
  • 150
2

I have been looking for a solution as well. This is - sadly - the only workaround I could find:

pkg=package-1.2.3-0
yum -y downgrade $pkg
yum -y install $pkg

These commands will result in your exact version being installed; when downgrading or upgrading.

Chris Maes
  • 35,025
  • 12
  • 111
  • 136
  • 1
    Tested this under CentOS 7, and there a `yum downgrade package-1.2.3.0` was sufficient - i.e. no additional `yum install ...` required. Is the `.rpm` suffix in your answer an oversight? – maxschlepzig Jul 13 '19 at 15:12
  • 1
    Yes yum downgrade suffices I it is a downgrade, but not when it is an upgrade and vice-versa – Chris Maes Jul 13 '19 at 16:34
0

yum update-to <package-name>

M-A-X
  • 404
  • 7
  • 15
0

For Centos 7 Static 32bit lib's:
Get http://mirror.centos.org/centos/7/os/x86_64/Packages/glibc-static-2.17-307.el7.1.i686.rpm

rpm -qlp glibc-static-2.17-307.el7.1.i686.rpm

rpm -ivh glibc-static-2.17-307.el7.1.i686.rpm
Arghya Sadhu
  • 41,002
  • 9
  • 78
  • 107