今天上服务器上执行yum install htop出现 import yummain导入报错No module named yummain,于是百度查找问题处理方案,但是网上数说 执行yum clean all 即可 但是这个yum都不能执行了 clean 肯定也不行
1:解决方式
1获取yummain的安装的py文件
[[email protected] ~]# wget http://yum.baseurl.org/download/3.4/yum-3.4.0.tar.gz
[[email protected] ~]# tar xf yum-3.4.0.tar.gz
[[email protected] ~]# cd yum-3.4.0
[[email protected] yum-3.4.0]# ls
AUTHORS cli.pyc INSTALL po test yumcommands.py
bin COPYING Makefile README TODO yumcommands.pyc
callback.py docs output.py rpmUtils utils.py yummain.py
ChangeLog etc output.pyc shell.py utils.pyc yum.spec
cli.py FAQ PLUGINS shell.pyc yum yum-updatesd.py
[[email protected] yum-3.4.0]# ./yummain.py install yum
base | 3.7 kB 00:00
base/primary_db | 4.5 MB 00:07
extras | 3.5 kB 00:00
extras/primary_db | 23 kB 00:03
出现以上提示就证明yum已经安装成功了。
2:执行yum命令即可
[[email protected] yum-3.4.0]# yum update
3:你的yum现在可以使用了
[[email protected] yum-3.4.0]# yum install -y htop
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package htop.x86_64 0:2.0.2-1.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
原文地址:http://blog.51cto.com/9025736/2063550