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

5

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!

Emulsion answered 27/5, 2016 at 19:39 Comment(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 in the Help Center. Perhaps Super User or Unix & Linux Stack Exchange would be a better place to ask. Also see Where do I post questions about Dev Ops?Calabro
@Calabro thanks for the heads up, I didn't know SO had branched out the infrastructure and ops pieces out into their own pages.Emulsion
T
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.

Tennessee answered 13/7, 2019 at 15:19 Comment(0)
K
5
yum downgrade somepackage

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

Knothole answered 2/5, 2018 at 8:17 Comment(0)
U
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.

Uneventful answered 13/2, 2019 at 15:36 Comment(2)
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?Tennessee
Yes yum downgrade suffices I it is a downgrade, but not when it is an upgrade and vice-versaUneventful
S
0

yum update-to <package-name>

Stria answered 22/2, 2017 at 8:44 Comment(0)
H
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
Helbonia answered 29/8, 2020 at 5:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.