No module named yum after upgrade to CentOS 7

General support questions
Post Reply
puuusome
Posts: 1
Joined: 2014/09/29 09:53:06

No module named yum after upgrade to CentOS 7

Post by puuusome » 2014/09/29 10:23:29

Hey,

I recently upgraded my CentOS 6.5 to CentOS 7 using the Preupgrade Assistant
sudo preupg
and the redhat-upgrade-tool
sudo /usr/bin/redhat-upgrade-tool-cli --network 7 --instrepo=http://mirror.centos.org/centos/7/os/x86_64
.

After the upgrade my yum is not working anymore.

Code: Select all

yum update
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.5 (default, Sep 11 2013, 16:55:54 )
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)]

If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/faq
I googled and I guess the problem occured because of the python upgrade during the CentOS 7 upgrade .
Is there any way to solve this problem?
I really appreciate any help you can provide.

PS: English is not my first language :)

vanecka
Posts: 45
Joined: 2010/01/28 21:05:11
Location: University of the Free State - South Africa
Contact:

Re: No module named yum after upgrade to CentOS 7

Post by vanecka » 2014/10/20 14:05:10

You can try to (re)install your python,gcc and yum:

Code: Select all

export my_mirror=http://mirror.ufs.ac.za/centos/7

rpm -Uvh $my_mirror/updates/x86_64/Packages/libgcc-4.8.2-16.2.el7_0.x86_64.rpm
rpm -Uvh $my_mirror/os/x86_64/Packages/cpp-4.8.2-16.el7.x86_64.rpm
rpm -Uvh $my_mirror/updates/x86_64/Packages/kernel-headers-3.10.0-123.8.1.el7.x86_64.rpm
rpm -Uvh $my_mirror/updates/x86_64/Packages/glibc-common-2.17-55.el7_0.1.x86_64.rpm \
               $my_mirror/updates/x86_64/Packages/glibc-2.17-55.el7_0.1.x86_64.rpm
rpm -Uvh $my_mirror/updates/x86_64/Packages/glibc-headers-2.17-55.el7_0.1.x86_64.rpm 
rpm -Uvh $my_mirror/updates/x86_64/Packages/glibc-devel-2.17-55.el7_0.1.x86_64.rpm 
rpm -Uvh $my_mirror/os/x86_64/Packages/mpfr-3.1.1-4.el7.x86_64.rpm
rpm -Uvh $my_mirror/os/x86_64/Packages/libmpc-1.0.1-3.el7.x86_64.rpm
rpm -Uvh $my_mirror/updates/x86_64/Packages/cpp-4.8.2-16.2.el7_0.x86_64.rpm
rpm -Uvh $my_mirror/updates/x86_64/Packages/gcc-4.8.2-16.2.el7_0.x86_64.rpm
rpm -Uvh $my_mirror/os/x86_64/Packages/python-2.7.5-16.el7.x86_64.rpm
rpm -Uvh $my_mirror/os/x86_64/Packages/yum-3.4.3-118.el7.centos.noarch.rpm

yum clean all
yum update

Post Reply

Return to “CentOS 7 - General Support”