标签归档文章: yum

解决Python升级为2.5高版本后yum不能使用的问题

# yum
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.4.3 (#1, Oct 14 2009, 01:52:50)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]

If you cannot solve this problem yourself, please go to
the yum faq at:

http://wiki.linux.duke.edu/YumFaq

直接修改 vim /usr/bin/yum
将 #!/usr/bin/python 修改为 #!/usr/bin/python2.4

使用yum提示This system is not registered with ULN / RHN

当你使用redhat linux el 版本或者oraclelinux 时, 使用yum安装和更新安装包时,会报如此错误。

$ yum search xxx or  install xxx

$ plugins: rhnplugin, security

$This system is not registered with RHN.RHN

$support will be disabled.

如果你不想去注册的话,其实注册看起来并不麻烦,需要申请一个账号,然后在linux里注册即可。 但是你忘了账号,或者懒的去注册时,那么你可以采取使用其他的包仓库。

打开 http://public-yum.oracle.com/ 页面。

如果你的系统是rhel5 或者 oracle linux 5 (oracle linux 是redhat el的姊妹系统)

# cd /etc/yum.repos.d

# wget http://public-yum.oracle.com/public-yum-el5.repo

Oracle Linux 6 or rhel 6
# cd /etc/yum.repos.d

# wget http://public-yum.oracle.com/public-yum-ol6.repo

然后你再试一下yum,你就可以使用public yum 库去更新包了。 虽然每次他还会提示那个support will be disabled.,但我们可以忽略掉了。