After yum is updated, "/usr/bin/yum", Line 29, in? Solution

Source: Internet
Author: User

The yum update method can be searched online.

After updating my yum, the following problems occur:

 

 

Code

 [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

 

 

 

 

I tried various methods:

1. Yum clean all

2. Modify/etc/yum. conf,

Code

 [Root @ The 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 # Replace with plugins = 0

# Note: Yum-RHN-plugin doesn't honor this.
Metadata_expire = 1 h

# Default.
# Installonly_limit = 3

# Put your repos here or in separate files named file. Repo
# In/etc/yum. Repos. d

 

3. Modify fastestmirror. conf

 

Code

 Fastestmirror. conf
[Root @ sunss-22 pluginconf. d] # Cat fastestmirror. conf
[Main]
Enabled = 1 # Replace with 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] #

Wait, a series of work won't work, and the final solution is as follows:

# Yum clean all
# Rm-F/var/lib/RPM/_ DB *
# Rpm -- rebuilddb
# Yum update

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.