Today, a new installation of a server, is going to use Yum to install GCC and other programs, the following problems appear:
Loading mirror speeds from cached hostfile
Traceback (most recent call last):
File "/usr/bin/yum", line <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, in _getts
Self._gettsinfo (remove_only)
File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line $, 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, 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.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)
Here is the solution:
cd/var/lib/rpm/
Rm-f __db.*
Yum Clean All
Well, it's no problem to use the Yum installer again.