0

I have been searching all over the internet for the instructions to install yum on CentOS. I haven't been able to find a single helpful source as all the links to yum packages are not working.

Why isn't there one easy universal way to install yum like installing python libraries using pip?

This is the error that I get when I type yum on my CentOS machine:

There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

No module named yum

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.14 |Anaconda, Inc.| (default, Mar 27 2018, 17:29:31)
[GCC 7.2.0]

Machine Specification:

LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.4.1708 (Core)
Release:    7.4.1708
Codename:   Core

I have both two versions of python:

  1. /usr/bin/python --> python2.7
  2. output of which python is /anaconda/envs/py35/bin/python

My system seems to be confused between two python versions.

I have yum in my /usr/bin/ as ls /usr/bin/ | grep yum returns:

yum
yum-builddep
yum-config-manager
yum-debug-dump
yum-debug-restore
yumdownloader
yum-groups-manager

When I try to install a yum from yum-3.4.3-158.el7.centos.noarch.rpm using rpm -i, I get a whole lot of conflicting errors:

file /usr/lib/python2.7/site-packages/rpmUtils/__init__.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/__init__.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/rpmUtils/arch.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/rpmUtils/miscutils.py from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/rpmUtils/miscutils.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/rpmUtils/oldUtils.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/rpmUtils/transaction.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/rpmUtils/updates.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/Errors.py from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/Errors.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/callbacks.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/comps.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/config.py from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/config.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/constants.py from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/constants.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/depsolve.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/drpm.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/failover.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/fssnapshots.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/history.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/i18n.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/igroups.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/logginglevels.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/mdparser.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/metalink.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/misc.py from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/misc.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/packageSack.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/packages.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/parser.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/pgpmsg.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/pkgtag_db.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/plugins.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/repoMDObject.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/repos.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/rpmsack.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/rpmtrans.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/sqlitesack.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/sqlutils.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/transactioninfo.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/update_md.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/updateinfo.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/yumRepo.py from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/lib/python2.7/site-packages/yum/yumRepo.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/share/yum-cli/yummain.py from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/share/man/man5/yum.conf.5 from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/share/man/man8/yum-shell.8 from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/share/man/man8/yum.8 from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/share/yum-cli/callback.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/share/yum-cli/cli.py from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/share/yum-cli/cli.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/share/yum-cli/output.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/share/yum-cli/shell.py from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/share/yum-cli/shell.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/share/yum-cli/utils.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/share/yum-cli/yumcommands.py from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/share/yum-cli/yumcommands.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch
file /usr/share/yum-cli/yummain.pyc from install of yum-3.4.3-158.el7.centos.noarch conflicts with file from package yum-3.4.3-154.el7.centos.noarch

I have tried deleting all yum related folders from /usr/bin, /usr/lib/python2.7/site-packages, and /usr/share/ to reinstall using the above command, but it gives the same error.

  • Try /usr/bin/python /usr/bin/yum to force Python 2.7 – Sven May 10 '18 at 11:05
  • Anaconda appears to have broken your Python environment. – Sven May 10 '18 at 11:07
  • Same error on using /usr/bin/python /usr/bin/yum !! no wonder I don't like Anaconda, but this is Azure machine; it comes preinstalled – pg2455 May 10 '18 at 11:08
  • 1
    reinstall OS or revert back to your OS stock python2.7 now your default python is 3.5 – Danila Ladner May 10 '18 at 12:38
  • 1
    read anaconda docs: To uninstall Anaconda open a terminal window and remove the entire anaconda install directory: rm -rf ~/anaconda. You may also edit ~/.bash_profile and remove the anaconda directory from your PATH environment variable, and remove the hidden .condarc file and .conda and .continuum directories which may have been created in the home directory with rm -rf ~/.condarc ~/.conda ~/.continuum. – Danila Ladner May 11 '18 at 13:59
0

Yum is a central part of CentOS and I don't think it's possible to have it not installed.

  • everytime I type yum, I get No module named yum – pg2455 May 10 '18 at 10:57
  • 1
    Type it where? Edit your question to give much more details, like how you installed the system, how you modified it and the exact output if you try to run yum (with copy/paste and the formatting tools). – Sven May 10 '18 at 10:58

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.