yum更新后"/usr/bin/yum", line 29, in ?的解决办法

yum的更新方法,可以到网上搜一下,这里不再累述。

我的yum更新后,出现的问题如下所示:

 

 

ContractedBlock.gif ExpandedBlockStart.gif 代码
 
   
[root@sunss - 22 yum . repos . d] # yum search php
================================================================== Matched : php ===================================================================
php
- pear . noarch : PHP Extension and Application Repository framework
compat
- readline43 . i386 : edline 4.3

compat
- readline43 . x86_64 : edline 4.3

fonts
- arabic . noarch : gollem - h3 . noarch : The Horde web - based File Manager .
hddtemp
. x86_64 : Hard disk temperature tool
horde
. noarch : The common Horde Framework for all Horde modules .
imp
- h3 . noarch : The Internet Messaging Program : webmail access to IMAP / POP3 accounts .
ingo
- h3 . noarch : The Horde web - based Email Filter Rules Manager .
Traceback (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 309 , in user_main
errcode
= main(args)
File " /usr/share/yum-cli/yummain.py " , line 178 , in main
result
, resultmsgs = base . doCommands()
File " /usr/share/yum-cli/cli.py " , line 349 , in doCommands
return self . yum_cli_commands[self . basecmd] . doCommand(self , self . basecmd , self . extcmds)
File " /usr/share/yum-cli/yumcommands.py " , line 627 , in doCommand
return base . search(extcmds)
File " /usr/share/yum-cli/cli.py " , line 813 , in search
self
. matchcallback(po , matched_value , args)
File " /usr/share/yum-cli/output.py " , line 818 , in matchcallback
print msg
UnicodeEncodeError
: ' gb2312 ' codec can ' t encode character u ' \ufffd ' in position 17: illegal multibyte sequence

 

 

 

 

试了各种办法:

1.yum clean all

2.修改/etc/yum.conf,

ContractedBlock.gif ExpandedBlockStart.gif 代码
 
   
[root @ sunss - 22 yum.repos.d] #
[root @ sunss - 22 yum.repos.d] # cat /etc/yum.conf
[main]
cachedir
=/ var / cache / yum
keepcache
= 0
debuglevel
= 2
logfile
=/ var / log / yum.log
distroverpkg
= redhat - release
tolerant
= 1
exactarch
= 1
obsoletes
= 1
gpgcheck
= 1
plugins
= 1 # 替换为plugins=0

# Note: yum-RHN-plugin doesn't honor this.
metadata_expire = 1h

# Default.
#
installonly_limit = 3

# PUT YOUR REPOS HERE OR IN separate files named file.repo
#
in /etc/yum.repos.d

 

3.修改fastestmirror.conf

 

ContractedBlock.gif ExpandedBlockStart.gif 代码
 
   
fastestmirror.conf
[root
@ sunss - 22 pluginconf.d] # cat fastestmirror.conf
[main]
enabled
= 1 # 替换为enabled=0
verbose = 0
socket_timeout
= 3
hostfilepath
=/ var / cache / yum / timedhosts.txt
maxhostfileage
= 10
maxthreads
= 15
# exclude=.gov, facebook
[root @ sunss - 22 pluginconf.d] #

等等,一系列工作都不行,最后解决办法:

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

转载于:https://www.cnblogs.com/sunss/archive/2010/07/27/1786235.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值