博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CentOS 中使用yum出现的“UnicodeDecodeError: 'ascii' codec”问题解决方法
阅读量:6252 次
发布时间:2019-06-22

本文共 2340 字,大约阅读时间需要 7 分钟。

问题

新装了CentOS 6.5系统,打算使用yum安装程序是出现了例如以下错误:

Loading mirror speeds from cached hostfileTraceback (most recent call last):  File "/usr/bin/yum", line 29, in 
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 136, in main result, resultmsgs = base.doCommands() File "/usr/share/yum-cli/cli.py", line 434, in doCommands self._getTs(needTsRemove) File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 99, in _getTs self._getTsInfo(remove_only) File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 110, in _getTsInfo pkgSack = self.pkgSack File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 887, in
pkgSack = property(fget=lambda self: self._getSacks(), File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 669, in _getSacks self.repos.populateSack(which=repos) File "/usr/lib/python2.6/site-packages/yum/repos.py", line 279, in populateSack self.doSetup() File "/usr/lib/python2.6/site-packages/yum/repos.py", line 105, in doSetup self.ayum.plugins.run('postreposetup') File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 184, in run func(conduitcls(self, self.base, conf, **kwargs)) File "/usr/lib/yum-plugins/fastestmirror.py", line 197, in postreposetup_hook if downgrade_ftp and _len_non_ftp(repo.urls) == 1: File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 699, in
urls = property(fget=lambda self: self._geturls(), File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 696, in _geturls self._baseurlSetup() File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 648, in _baseurlSetup self.mirrorurls = self._replace_and_check_url(mirrorurls) File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 691, in _replace_and_check_url print 'YumRepo Error: All mirror URLs are not using ftp, http[s] or file.\n Eg. %s' % misc.to_utf8(skipped) File "/usr/lib64/python2.6/codecs.py", line 351, in write data, consumed = self.encode(object, self.errors)UnicodeDecodeError: 'ascii' codec can't decode byte 0xbc in position 3746: ordinal not in range(128)

解决方式

依次运行下面操作:

cd /var/lib/rpm/rm -i __db.*yum clean allyum history new

转载地址:http://ncysa.baihongyu.com/

你可能感兴趣的文章
MySQL 二进制日志过滤
查看>>
Centos下Tomcat 安装Apache Portable Runtime
查看>>
【BZOJ】2563: 阿狸和桃子的游戏
查看>>
redis 中文字符显示
查看>>
webview与JS的交互
查看>>
吴翼大神
查看>>
在Gridview如何进行每行单元格比较
查看>>
国内外MD5在线解密网站
查看>>
插件五之滚动条jquery.slimscroll.js
查看>>
187实现录制视频功能
查看>>
教你pomeloclient包libpomelo增加cocos2d-x 3.0工程(Windows、Android、IOS平台)
查看>>
CSS3实现时间轴效果
查看>>
经典回忆Effective C++ 1
查看>>
JQUERY名称冲突
查看>>
poj 1975 Median Weight Bead(传递闭包 Floyd)
查看>>
【C++ Primer每天刷牙】一间 迭代器
查看>>
:施密特建议尾随年轻的专业人士了解技术公司
查看>>
软件项目如何选型
查看>>
UVa 11205 - The broken pedometer
查看>>
[书目20150727]选择重于一切(扎克伯格给年轻人的37个人生忠告)
查看>>