今天上服务器上执行yum install htop出现 import yummain导入报错No module named yummain,于是百度查找问题处理方案,但是网上数说 执行yum clean all 即可 但是这个yum都不能执行了 clean 肯定也不行
1:解决方式
1获取yummain的安装的py文件
[root@iZ2zeilmai38op3fw0apl7Z ~]# wget
[root@iZ2zeilmai38op3fw0apl7Z ~]# tar xf yum-3.4.0.tar.gz
[root@iZ2zeilmai38op3fw0apl7Z ~]# cd yum-3.4.0
[root@iZ2zeilmai38op3fw0apl7Z 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
[root@iZ2zeilmai38op3fw0apl7Z 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命令即可
[root@iZ2zeilmai38op3fw0apl7Z yum-3.4.0]# yum update
3:你的yum现在可以使用了
[root@iZ2zeilmai38op3fw0apl7Z yum-3.4.0]# yum install -y htopLoaded 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