Yum Problem after Python Upgrade

Yum Problem after Python Upgrade


I upgrade my Python to 2.6.1, my yum met this problem:

>sudo yum install httpd

error message:

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.6.1 (r261:67515, Aug 23 2011, 00:34:37)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-11)]

If you cannot solve this problem yourself, please go to
the yum faq at:
http://wiki.linux.duke.edu/YumFaq

solutions:
>wget http://linux.duke.edu/projects/yum/download/2.0/yum-2.0.7.tar.gz
>tar -xvzf yum-2.0.7.tar.gz
>cd yum-2.0.7
>./configure
>make
>sudo make install

error message:
>yum
Traceback (most recent call last):
File "/usr/bin/yum", line 22, in <module>
import yummain
File "/usr/share/yum/yummain.py", line 22, in <module>
import clientStuff
File "/usr/share/yum/clientStuff.py", line 18, in <module>
import rpm
ImportError: No module named rpm

trying the latest yum
>wget http://yum.baseurl.org/download/3.4/yum-3.4.3.tar.gz
>sudo rm /usr/bin/yum
>sudo rm /usr/bin/yum-arch
>tar zxvf yum-3.4.3.tar.gz
>cd yum-3.4.3
>sudo make
>sudo make install

It is not good here.

Try to put the python version down
>sudo rm /usr/bin/python
>sudo ln -s /usr/bin/python2.3.4 /usr/bin/python
>python -V
Python 2.3.4

error messages:
Traceback (most recent call last):
File "/usr/bin/yum", line 28, in ?
import yummain
File "/usr/share/yum-cli/yummain.py", line 29, in ?
from yum import logginglevels
ImportError: cannot import name logginglevels

solutions:
>echo $PYTHONPATH
>PYTHONPATH=/usr/share/yum-cli:/usr/share/yum

try to install 2.0.7 again. That is great, it works.
>yum --version
2.0.7
>sudo yum install httpd
error messages:
retrygrab() failed for:
http://mirror.dulug.duke.edu/pub/yum-repository/redhat/4/i386/headers/header.info
Executing failover method
failover: out of servers to try
Error getting file http://mirror.dulug.duke.edu/pub/yum-repository/redhat/4/i386/headers/header.info
[Errno 4] IOError: <urlopen error >

solutions:
change the configuration to use a new repository
>vi /etc/yum.conf
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1

[base]
name=CentOS-$releasever – Base
baseurl=http://mirror.centos.org/centos/4/os/i386/
gpgcheck=1

[updates]
name=Red Hat Linux $releasever – Updates
baseurl=http://mirror.centos.org/centos/4/updates/i386/
gpgcheck=1

references:
http://techtrouts.com/how-to-install-yum-on-red-hat-enterprise-linux-4/
http://yum.baseurl.org/download/3.4/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值