CentOS 6.4 was just installed yesterday and was originally intended to install nagios in CentOS. However, when installing the prepared environment, an error was reported using the yum command. The error code is as follows:
[Root @ Centos yum. repos. d] # yum install-y php httpd gcc glibc-common gd-devel php-mysql-server php-snmp php-pdo perl-DBD-MYSQL php-pear
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
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 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 <lambda>
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 <lambda>
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. Required URLs = self. _ replace_and_check_url (required URLs)
File "/usr/lib/python2.6/site-packages/yum/yumRepo. py", line 691, in _ replace_and_check_url
Print 'yum repo 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 0xd1 in position 72: ordinal not in range (128)
Tried the following methods:
Method 1:
Set the plugins in the/etc/yum. conf file to 0.
Failed, so I tried Method 2:
Yum clean all
If the problem persists, try method 3:
Cd/var/lib/rpm/
Rm-I _ db .*
Yum clean all
Yum history new
The problem is solved.
This article is from the "Xie haitang" blog, please be sure to keep this source http://xiehaitang.blog.51cto.com/4914337/1300940