Yum appears "Unicodedecodeerror: ' ASCII ' codec" solution

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.