运行yum提示多个python版本问题
# yum clean all
Unknown option: --
usage: /usr/bin/python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.
解决方式
系统中存在多个python,查看/usr/bin/yum,将首行改成相应的python
#!/usr/bin/python
No module named urlgrabber.grabber
# yum makecache
Loaded plugins: fastestmirror, langpacks
base | 2.9 kB 00:00:00
epel | 2.9 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
Traceback (most recent call last):
File "/usr/libexec/urlgrabber-ext-down", line 22, in <module>
from urlgrabber.grabber import \
ImportError: No module named urlgrabber.grabber
Traceback (most recent call last):
File "/usr/libexec/urlgrabber-ext-down", line 22, in <module>
from urlgrabber.grabber import \
ImportError: No module named urlgrabber.grabber
解决方式:
编辑/usr/libexec/urlgrabber-ext-down文件改成对应的python
lvm.LibLVMError: (0, '')错误
错误信息
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in <module>
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 365, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 271, in main
return_code = base.doTransaction()
File "/usr/share/yum-cli/cli.py", line 773, in doTransaction
resultobject = self.runTransaction(cb=cb)
File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1736, in runTransaction
if self.fssnap.available and ((self.conf.fssnap_automatic_pre or
File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1126, in <lambda>
fssnap = property(fget=lambda self: self._getFSsnap(),
File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1062, in _getFSsnap
devices=devices)
File "/usr/lib/python2.7/site-packages/yum/fssnapshots.py", line 158, in __init__
self._vgnames = _list_vg_names() if self.available else []
File "/usr/lib/python2.7/site-packages/yum/fssnapshots.py", line 56, in _list_vg_names
names = lvm.listVgNames()
lvm.LibLVMError: (0, '')
解决方式:
# mkdir /tmp/down/
# yum install --downloadonly --downloaddir=/tmp/down/ yum
# cd /tmp/down/
# rpm -Uvh *
# yum clean metadata
# yum clean all