r1 - 17 Jul 2008 - 02:48:21 - Main.yfangYou are here: YWiki >  MyTroubleShooting Web > Yum不能执行了

Yum不能执行了

问题描述

  • 时间 2008.7.17
  • OS CentOS5? .1升级到CentOS5.2后
  • 症状 执行yum update 报错
[root@localhost ~]# 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 storagefactory

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, May 24 2008, 13:47:28)
[GCC 4.1.2 20070626 (Red Hat 4.1.2-14)]

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

问题原因

  • 昨晚最后执行的命令是yum update,因为是系统第一次执行,而且系统只有128M内存,这个过程很慢,当然不是在网络上,看着他一点点走,太累了,就^Z,然后bg 1,本以为今天来了应该已经好了,结果发现事与愿违,出现各种系统错误,包括Gnome下文件找不到,rpm更新到一半,yum程序都没有装上,/bin/rpm虽然在,可是包管理器中却看不到rpm这个包的身影,sshd虽然装上了,ntsysv中却找不到这个服务了,网络也上不去了,一团糟。

解决方案

  • 兵来将挡,先把网络手动配好,可以远程连接了
  • 在yum cache中找到自己已经下好的rpm包,使用Uvh模式升级安装
[root@localhost packages]# find /var/cache/yum/ -name "rpm*"
/var/cache/yum/base/headers/rpm-python-4.4.2-48.el5.i386.hdr
/var/cache/yum/base/headers/rpm-libs-4.4.2-48.el5.i386.hdr
/var/cache/yum/base/headers/rpm-4.4.2-48.el5.i386.hdr
/var/cache/yum/base/packages/rpm-4.4.2-48.el5.i386.rpm
/var/cache/yum/base/packages/rpm-libs-4.4.2-48.el5.i386.rpm
/var/cache/yum/base/packages/rpm-python-4.4.2-48.el5.i386.rpm

[root@localhost packages]# rpm -Uvh /var/cache/yum/base/packages/rpm-4.4.2-48.el5.i386.rpm /var/cache/yum/base/packages/rpm-python-4.4.2-48.el5.i386.rpm /var/cache/yum/base/packages/rpm-libs-4.4.2-48.el5.i386.rpm
Preparing...                ########################################### [100%]
   1:rpm-libs               ########################################### [ 33%]
   2:rpm                    warning: /etc/cron.daily/rpm created as /etc/cron.daily/rpm.rpmnew
warning: /etc/logrotate.d/rpm created as /etc/logrotate.d/rpm.rpmnew
########################################### [ 67%]
   3:rpm-python             ########################################### [100%]
  • 接下来安装yum程序
[root@localhost packages]# rpm -Uvh /var/cache/yum/updates/packages/yum-3.2.8-9.el5.centos.2.1.noarch.rpm
  • 安装成功之后在手动执行yum update,就好了!其实我猜想系统中还有一些别的问题,不过不好查了,下次遇到再说吧,等到下次软件升级应该就能解决。

多说几句

  • 用了这么久CentOS和yum,实在不知道这个东西中断后的后果这么严重,其实也考虑到了,没想到调到后台执行也不行,所以以后yum update的时候要小心,尽量看着让他跑完
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
Powered by YWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding YWiki? Send feedback