0

In my CentOS 7, the yum is malfunctioned. I want to reinstall it. However, my "rpm" version is too low to reinstall yum? How can I upgrade rpm on CentOS 7? Thanks. NOTE: I logged in as a root. And all these are done on a cluster, not personal computer. Here are what I have done and the message I received.

rpm -U rpm-apidocs-4.11.3-40.el7.noarch
package rpm-apidocs-4.11.3-40.el7.noarch is already installed # not surprised because I have upgraded it

rpm -Uvh yum-3.4.3-163.el7.centos.noarch.rpm
error: Failed dependencies:
    rpm >= 0:4.11.3-22 is needed by yum-3.4.3-163.el7.centos.noarch

rpm --prefix="/usr/bin/" -U rpm-apidocs-4.11.3-40.el7.noarch.rpm 
error: package rpm-apidocs is not relocatable

Is it possible for me to install all dependencies together, like one command can install all dependencies and the package? I sincerely appreciate your time. rpm -Uvh yum-3.4.3-163.el7.centos.noarch.rpm error: Failed dependencies: rpm >= 0:4.11.3-22 is needed by yum-3.4.3-163.el7.centos.noarch


rpm -U rpm-4.11.3-40.el7.x86_64.rpm 
error: Failed dependencies:
    rpm = 4.11.3-21.el7 is needed by (installed) rpm-libs-4.11.3-21.el7.x86_64
    rpm = 4.11.3-21.el7 is needed by (installed) rpm-python-4.11.3-21.el7.x86_64
    rpm = 4.11.3-21.el7 is needed by (installed) rpm-devel-4.11.3-21.el7.x86_64
    rpm = 4.11.3-21.el7 is needed by (installed) rpm-build-4.11.3-21.el7.x86_64


rpm -U rpm-libs-4.11.3-40.el7.x86_64.rpm 
error: Failed dependencies:
    rpm = 4.11.3-40.el7 is needed by rpm-libs-4.11.3-40.el7.x86_64
    rpm-libs(x86-64) = 4.11.3-21.el7 is needed by (installed) rpm-build-libs-4.11.3-21.el7.x86_64
    rpm-libs(x86-64) = 4.11.3-21.el7 is needed by (installed) rpm-devel-4.11.3-21.el7.x86_64

================================================================================

rpm -qR rpm-4.11
package rpm-4.11 is not installed

rpm -i http://mirror.alpha-labs.net/centos/7/os/x86_64/Packages/rpm-4.11.3-40.el7.x86_64.rpm
    file /bin/rpm from install of rpm-4.11.3-40.el7.x86_64 conflicts with file from package rpm-4.11.3-21.el7.x86_64
    file /usr/bin/rpm2cpio from install of rpm-4.11.3-40.el7.x86_64 conflicts with file from package rpm-4.11.3-21.el7.x86_64
    file /usr/bin/rpmdb from install of rpm-4.11.3-40.el7.x86_64 conflicts with file from package rpm-4.11.3-21.el7.x86_64
    file /usr/bin/rpmkeys from install of rpm-4.11.3-40.el7.x86_64 conflicts with file from package rpm-4.11.3-21.el7.x86_64
    file /usr/lib/rpm/rpmpopt-4.11.3 from install of rpm-4.11.3-40.el7.x86_64 conflicts with file from package rpm-4.11.3-21.el7.x86_64
    file /usr/share/man/man8/rpm.8.gz from install of rpm-4.11.3-40.el7.x86_64 conflicts with file from package rpm-4.11.3-21.el7.x86_64


rpm -iUvh http://mirror.alpha-labs.net/centos/7/os/x86_64/Packages/rpm-4.11.3-40.el7.x86_64.rpm
Retrieving http://mirror.alpha-labs.net/centos/7/os/x86_64/Packages/rpm-4.11.3-40.el7.x86_64.rpm
error: Failed dependencies:
    rpm = 4.11.3-21.el7 is needed by (installed) rpm-libs-4.11.3-21.el7.x86_64
    rpm = 4.11.3-21.el7 is needed by (installed) rpm-python-4.11.3-21.el7.x86_64
    rpm = 4.11.3-21.el7 is needed by (installed) rpm-devel-4.11.3-21.el7.x86_64
    rpm = 4.11.3-21.el7 is needed by (installed) rpm-build-4.11.3-21.el7.x86_64
  • Do you have the rpm2cpio and cpio programs installed? – icarus Feb 4 at 5:52
1

Download the last version of rpm from CentOS 7 and update it:

rpm -U rpm-version......

then download yum packages and update it on the same way

The package you need to update is rpm not rpm-apidocs. Here is one mirror of this package: http://mirror.alpha-labs.net/centos/7/os/x86_64/Packages/rpm-4.11.3-40.el7.x86_64.rpm

To get list of dependencies you can use command:

rpm -qR rpm-version....

and install them on this way:

rpm -i pkg1 pkg2 pkg3

You do not need to download them, rpm understand http protocol so you can install on this way:

rpm -i http://mirror.alpha-labs.net/centos/7/os/x86_64/Packages/rpm-4.11.3-40.el7.x86_64.rpm

The update will be line like this one:

rpm -Uvh http://mirror.alpha-labs.net/centos/7/os/x86_64/Packages/rpm-4.11.3-40.el7.x86_64.rpm \
http://mirror.alpha-labs.net/centos/7/os/x86_64/Packages/rpm-libs-4.11.3-21.el7.x86_64.rpm \
http://mirror.alpha-labs.net/centos/7/os/x86_64/Packages/rpm-python-4.11.3-21.el7.x86_64.rpm \
http://mirror.alpha-labs.net/centos/7/os/x86_64/Packages/rpm-devel-4.11.3-21.el7.x86_64.rpm \
http://mirror.alpha-labs.net/centos/7/os/x86_64/Packages/rpm-build-4.11.3-21.el7.x86_64.rpm
| improve this answer | |
  • I sincerely appreciate your time and suggestion. I did it. It looks I installed it successfully when I use "rpm --version". However, when I run rpm to upgrade yum, I still got the low version message. Any suggestion? – Leon Feb 4 at 14:56
  • @Leon, can you add in question the exact commands you run and exact error message(s) you get – Romeo Ninov Feb 4 at 14:58
  • thanks. Yes. I updated my questions. The commands and error messages were appended in the question. I sincerely appreciate your time and help. – Leon Feb 4 at 15:41
  • @leon, you update wrong package, please check my edited answer – Romeo Ninov Feb 4 at 15:50
  • 1
    You are so nice! Yes I got it. I sincerely appreciate your time and help. – Leon Feb 4 at 20:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.