In CentOS, the "UnicodeDecodeError: & #39; ascii & #39; codec" problem occurs in yum.

Source: Internet
Author: User

In CentOS, the "UnicodeDecodeError: 'ascii 'codec" problem occurs in yum.
Problem

When CentOS 6.5 is installed, the following error occurs when you plan to use the yum Installer:

Loading mirror speeds from cached hostfileTraceback (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.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)

Solution

Perform the following operations in sequence:

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



The following error occurs when you use yum to install mplayer in centos. Only the last error is listed.

The problem is that the so library files listed here are too old,
Mplayer depends on the updated library file,
There are some solutions, but they are very troublesome,
You need to manually download these library files and copy them to the corresponding address to establish a connection,
Or download the rpm package containing these library files for manual installation,
However, the latter may fail because other dependencies are not satisfied,
The best way is to use fedora...
Both fedora and centos are the sons of redhat. Apart from the newer software source fedora, there are many software sources, all of which are the same.
Centos is designed for servers. Therefore, in pursuit of stability and security, software and other things are not up-to-date. It is not suitable for Personal desktop systems. Similarly, centos cannot be installed Using wps and sogouinput methods.
Mplayer is from a third-party yum source, so centos cannot meet the dependency and cannot be installed. Think about how to install mplayer on that server.

Therefore, we sincerely recommend that you change fedora to learn more about centos commands, server setup, and other functions that can be completed by centos, and install the latest software for desktop users ~ Such as WPS and mplayer.

How to install mysql using yum in centos 65

The solution is as follows:

# Cd/etc/

# Ls

Find yum. repos. d. This directory contains a file zl. repo (this name may not be in your machine and the name should be customized). Compile the URL baseurl in vi = centos.ustc.edu.cn/centos/5/ OS/I/

Then # yum clean all

Related Article

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.