码迷,mamicode.com
首页 > 其他好文 > 详细

yum提示字符编码错误

时间:2015-06-02 10:55:19      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:

1、问题描述:

技术分享
[root@localhost data]# yum
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
You need to give some command
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 285, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 105, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 310, in getOptionsConfig
    self.parseCommands() # before we return check over the base command + args
  File "/usr/share/yum-cli/cli.py", line 333, in parseCommands
    self.usage()
  File "/usr/share/yum-cli/cli.py", line 1340, in usage
    sys.stdout.write(self.optparser.format_help())
  File "/usr/lib64/python2.6/optparse.py", line 1641, in format_help
    result.append(self.get_usage() + "\n")
  File "/usr/lib64/python2.6/optparse.py", line 1583, in get_usage
    self.expand_prog_name(self.usage))
  File "/usr/lib64/python2.6/optparse.py", line 374, in format_usage
    return _("Usage: %s\n") % usage
UnicodeDecodeError: ascii codec cant decode byte 0xe4 in position 0: ordinal not in range(128)
View Code

2、解决方法:

一、
#yum clean all
#rm -f /var/lib/rpm/__db*
#rpm --rebuilddb
#yum update 

二、
# vim /etc/yum.conf
找到下面一行:
plugins=1 #替换为plugins=0

三、

 # vim fastestmirror.conf 

  enabled=1 #替换为enabled=0             这步貌似可以忽略

 3、参考网址:

http://www.cnblogs.com/sunss/archive/2010/07/27/1786235.html

yum提示字符编码错误

标签:

原文地址:http://www.cnblogs.com/chinas/p/4545535.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!