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/
分享到:
相关推荐
linux安装yum对应python2.7.5包
主要介绍了解决yum对python依赖版本问题,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
Centos重新安装python和yum的rpm文件
Python2.7库包(共17个): rpm-python-4.11.3-40.el7.x86_64.rpm python-srpm-macros-3-32.el7.noarch.rpm python-setuptools-0.9.8-7.el7.noarch.rpm python-rpm-macros-3-32.el7.noarch.rpm libxml2-python-...
dbus-python-devel-1.1.1-9.el7.x86_64.rpm python-2.7.5-89.el7.x86_64.rpm python-iniparse-0.4-9.el7.noarch.rpm python-libs-2.7.5-89.el7.x86_64.rpm python-pycurl-7.19.0-19.el7.x86_64.rpm python-...
1.rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps 删除python 2. whereis python |xargs rm -frv 删除所有残余文件 ...rpm -Uvh --force --nodeps --replacepkgs rpm-python*.rpm yum*.rpm
linux安装yum用到包,网上的都是老版本的,且有些包不容易找,我包包整合一起了,根据提示依赖的先后顺序安装即可,亲测有效
轻量级python爬虫脚本,用于爬各yum源镜像站,并且能自动创建目录和文件
centos6.5为例,升级python2.7后,导致yum无法使用,采用以下rpm包可以还原
这个包安装网易镜像版本时,出现依赖错误,要求安装高版本Python-urlgrabber,下载高版本的Python-urlgrabber安装时,出现一系列的依赖错误,此时可以通过该资源进行替换yum-3.4.3-158.el7.centos.noarch.rpm来解决...
有时候我们不小心卸载了centos 自带的python2.7, 导致了yum不能使用, 这时我们需要冲洗你安装 python2.7 和 yum, 此资源包含 python2.7和yum相关的软件和安装教程。
优势不小心卸载了yum,或者python;此时先卸载将Centos7中的python2.7和yum相关程序完全卸载,然后一键重装,很简单。
Centos卸载yum及重装
近日由于使用需要python3,于是手贱把系统自带的python2 给卸载了,然后发现yum 无法使用,检查发现yum 是使用Python 写的,因此需要进行恢复,先直尝试把yum指定到重新安装的python2,但由于版本等问题,仍旧不能...
至2019-07-10,centos 7 最新的 Python和yum离线安装包,包里有安装教程,照着做即可。
yum-4.7.0-4.el8.noarch.rpm lrzsz-0.12.20-43.el8.x86_64.rpm libnsl-2.28-164.el8.i686.rpm libnsl-2.28-164.el8.x86_64.rpm yum-utils-4.0.21-3.el8.noarch.rpm vim-minimal-8.0.1763-16.el8.x86_64.rpm python3-...
在删除 python2 版本后导致 yum 不好使需要的 rmp 的所有包。
yum install python-pip 后来google了一下说是这个包在EPEL源里,要添加EPEL源才可以。然后按博客里说的方法添加,执行以下命令: sudo rpm -ivh epel-release* 但是最后提示系统里已经安装了最新的epel包,但为...
解决对于误删Linux系统自带的Python导致的Yum用不了的问题