zoukankan      html  css  js  c++  java
  • yum更新后"/usr/bin/yum", line 29, in ?的解决办法

    yum的更新方法,可以到网上搜一下,这里不再累述。

    我的yum更新后,出现的问题如下所示:

    代码
    [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

    试了各种办法:

    1.yum clean all

    2.修改/etc/yum.conf,

    代码
    [root@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 #替换为plugins=0

    # Note: yum-RHN-plugin doesn't honor this.
    metadata_expire=1h

    # Default.
    #
    installonly_limit = 3

    # PUT YOUR REPOS HERE OR IN separate files named file.repo
    #
    in /etc/yum.repos.d

    3.修改fastestmirror.conf

    代码
    fastestmirror.conf
    [root
    @sunss-22 pluginconf.d]# cat fastestmirror.conf
    [main]
    enabled
    =1 #替换为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]#

    等等,一系列工作都不行,最后解决办法:

    #yum clean all
    #rm -f /var/lib/rpm/__db*
    #rpm --rebuilddb
    #yum update 

  • 相关阅读:
    ThinkPHP第八天(U函数放置在外部JS不会被解析,错误界面定制,错误信息变量)
    ThinkPHP第七天(F函数使用,项目分组配置,项目分组模板文件放置规则配置)
    thinkphp第二天
    ThinkPHP第五天(提交类型判定常量IS_POST等,错误页面种类,Model实例化方式,模板中使用函数,foreach循环,模板中.语法配置)
    高阶函数、函数嵌套和闭包
    递 归
    函数式编程
    命名空间
    函数的参数
    循环语句
  • 原文地址:https://www.cnblogs.com/sunss/p/1786235.html
Copyright © 2011-2022 走看看