Bash   发布时间:2022-05-13  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了解决yum不能正常使用的问题大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
解决yum不能正常使用的问题

问题1

Another app is currently holding the yum lock; waiTing for it to exit...
  The other application is: yum
    Memory :  19 M RSS (303 MB VSz)
    Started: Wed Mar 21 11:11:28 2018 - 02:52 ago
    State  : Traced/Stopped,pid: 6373
Another app is currently holding the yum lock; waiTing for it to exit...
  The other application is: yum
    Memory :  19 M RSS (303 MB VSz)
    Started: Wed Mar 21 11:11:28 2018 - 02:54 ago
    State  : Traced/Stopped,pid: 6373

解决方法:
1、这是yum被锁了,是因为之前执行了一遍未把进程完整的停掉
ps aux | grep yum |grep -v grep |awk ‘{print $2}’ | xargs kill -9
? 2、直接删掉yum的pid文件,pid文件是用来管理服务的启动,关闭。
rm -rf /var/run/yum.pid

问题2

# yum install lrzsz -y  
There was a problem imporTing one of the Python modules
required to run yum. The error leading to this problem was:
   /usr/lib64/python2.6/site-packages/pycurl.so: undefined symbol: CRYPTO_set_locking_callBACk
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.6 (r266:84292,Nov 22 2013,12:16:22) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]
If you cAnnot solve this problem yourself,please go to 
the yum faq at:
  http://yum.baseurl.org/wiki/Faq

解决:
rm -f /var/lib/rpm/__db*
rpm --rebuilddb
再安装,需要加上sudo
sudo yum install lrzsz -y

问题3、
1、使用yum安装测试

# yum install iotop  
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,which is:
2.7.13 (default,Nov 13 2017,14:44:54) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-55)]
If you cAnnot solve this problem yourself,please go to 
the yum faq at:
  http://wiki.linux.duke.edu/YumFaq

备注:没有模块yum

2、查看yum使用的语言

# which yum `
/usr/bin/yum
[[email protected]_wwwyufabu_216_37 ~]# cat /usr/bin/yum 
#!/usr/bin/python  (使用的是Python的默认版本)
import sys
try:
    import yum
except ImportError:
    print >> sys.stderr,"""There was a problem imporTing one of the Python modules
required to run yum. The error leading to this problem was
```:
.................................

备注:
Python编写的,调用yum模块失败

3、查看Python版本

# python
python     python2    python2.4  python2.7 
# python   (Python默认版本调用失败)
Python 2.7.13 (default,14:44:54) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-55)] on linux2
Type "Help","copyright","credits" or "license" for more @R_85_4036@ion.
>>> import yum
TraceBACk (most recent call last):
  File "<stdin>",line 1,in <module>
ImportError: No module named yum
>>> 
[1]+  Stopped                 python
# python2 (python2版本调用失败)
Python 2.7.13 (default,in <module>
ImportError: No module named yum
>>> 
[2]+  Stopped                 python2
# python2.4 (Python2.4版本调用成功)
Python 2.4.3 (#1,Jan 21 2009,01:10:13) 
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2
Type "Help","credits" or "license" for more @R_85_4036@ion.
>>> import yum
>>>

4、修改yum文件中的Python版本

# cat /usr/bin/yum 
#!/usr/bin/python2.4
import sys
try:
    import yum
except ImportError:
    print >> sys.stderr,"""There was a problem imporTing one of the Python modules
required to run yum. The error leading to this problem was:

大佬总结

以上是大佬教程为你收集整理的解决yum不能正常使用的问题全部内容,希望文章能够帮你解决解决yum不能正常使用的问题所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: