`
sillycat
  • 浏览: 2559809 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

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/


分享到:
评论

相关推荐

    linux安装yum对应python2.7.5包

    它依赖于Python解释器来运行,因此确保系统的Python版本与`yum`兼容至关重要。在本案例中,我们需要将Linux系统中的`yum`配置为使用Python 2.7.5版本。以下是详细步骤和相关知识点: 1. **检查当前Python版本** ...

    解决yum对python依赖版本问题

    ### 解决yum对Python依赖版本问题 在Linux环境中,`yum`(Yellowdog Updater Modified)是Red Hat系列操作系统中的包管理工具之一,用于安装、更新及卸载软件包。通常情况下,`yum`默认使用系统提供的Python版本来...

    python升级2.7后导致yum无法使用还原包

    在Linux系统中,Python是许多核心工具和系统服务的基础,包括`yum`包管理器。在CentOS 6.5中,默认的Python版本是2.6,但有时用户可能需要升级到2.7以满足某些特定软件的需求。然而,升级Python可能会导致与系统组件...

    Linux安装yum的依赖包及说明(python2.7.5)

    1. `python-libs-2.7.5-89.el7.x86_64.rpm`:这是Python标准库的一个组件,包含许多Python运行时所需的库,对`yum`的正常运行至关重要。 2. `yum-3.4.3-168.el7.centos.noarch.rpm`:这就是`yum`的主程序包,提供了...

    Python2.7库包&yum库包.zip

    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-...

    linux 更新yum 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-...

    Centos重新安装python和yum的文件

    在CentOS系统中,Python和YUM是两个非常重要的组件。Python是通用的脚本语言,而YUM(Yellowdog Updater, Modified)是CentOS的包管理器,用于安装、更新和卸载软件包。当这两个组件出现问题或需要升级时,可能需要...

    linux操作,centos8修改yum,安装python3,dlib等

    linux操作,centos8修改yum,安装python3,dlib等

    Centos7重新安装 python2.7 和 yum

    有时候我们不小心卸载了centos 自带的python2.7, 导致了yum不能使用, 这时我们需要冲洗你安装 python2.7 和 yum, 此资源包含 python2.7和yum相关的软件和安装教程。

    centos6重装python和yum用到的yum、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

    RHEL7更新yum包,python-urlgrabber版本低错误

    这个包安装网易镜像版本时,出现依赖错误,要求安装高版本Python-urlgrabber,下载高版本的Python-urlgrabber安装时,出现一系列的依赖错误,此时可以通过该资源进行替换yum-3.4.3-158.el7.centos.noarch.rpm来解决...

    yum源python爬虫脚本

    轻量级python爬虫脚本,用于爬各yum源镜像站,并且能自动创建目录和文件

    Centos卸载yum及重装yum-python.zip

    在整个过程中,`Python`起着关键的作用,因为`YUM`是用Python编写的,它依赖于特定版本的Python运行。确保你的系统中的Python环境与`yum`兼容,是成功重装的关键。 总结来说,卸载和重装`YUM`是一个涉及多个步骤的...

    yum+python安装资源包

    yum+python安装资源包

    yum-python-rpm.rar

    标题“yum-python-rpm.rar”所指的,是针对Linux系统中使用YUM(Yellowdog Updater, Modified)包管理器时遇到的问题,特别是当Python2被移除后导致YUM无法正常工作的情况。YUM是RPM软件包管理器的一个前端,用于在...

    python2.6和yum所需要用到的所有rpm包

    Python 2.6和Yum是Linux系统中两个至关重要的组件。Python 2.6是一个早期版本的Python解释器,而Yum(Yellowdog Updater, Modified)是Red Hat Enterprise Linux及其衍生版中的包管理器。这个压缩包包含了在重新安装...

    Centos7 python2.7和yum资源包

    在Linux系统中,CentOS 7是广泛使用的服务器操作系统,其默认使用Python 2.7作为基础组件,而`yum`则是系统管理中用于安装、更新和管理软件包的重要工具。如果你不小心卸载了`yum`或Python 2.7,这可能会导致系统...

    CentOS误删Yum和Python解决方案和rmp包下载

    然而,如果用户不慎误删了系统自带的Python或者与Yum相关的组件,可能会导致Yum无法正常使用,严重影响系统的正常运行。本篇文章将详细介绍如何解决这一问题,并提供必要的RPM包资源进行修复。 首先,让我们了解`...

    CentOS下使用yum安装python-pip失败的完美解决方法

    yum install python-pip 后来google了一下说是这个包在EPEL源里,要添加EPEL源才可以。然后按博客里说的方法添加,执行以下命令: sudo rpm -ivh epel-release* 但是最后提示系统里已经安装了最新的epel包,但为...

    CentOS 7 yum源安装软件包

    rpm -ivh python-urlgrabber-3.10-8.el7.noarch.rpm rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-3.4.3-150.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm

Global site tag (gtag.js) - Google Analytics