robertlin 发表于 2005-8-19 07:20:46

FC4更新时出现错误,恳请朋友帮帮忙谢了!

我的机子是笔记本Dell D600. 安装是XP和FC4双系统。在安装完FC4并使用yum正常升级之后,开始设置使用英文环境,安装了中文输入法。只是改动了二处:一处是/etc/sysconfig/i18n里加入LC_CTYPE=“zh_CN“。另一处是用户目录下编辑.bashrc文件:
    $vi ~/.bashrc添加如下内容:
    export XMODIFIERS=”@im=scim”
    export XIM=scim
    export XIM_PROGRAM=scim
没有发现什么问题,今天用yum升级时发现问题。下面是出现的提示,哪一位朋友帮帮我,多谢谢了!

robertlin 发表于 2005-8-19 07:22:10

这是提示
# yum update
Traceback (most recent call last):
File "/usr/bin/yum", line 15, in ?
    yummain.main(sys.argv)
File "/usr/share/yum-cli/yummain.py", line 34, in main
    locale.setlocale(locale.LC_ALL, '')
File "/usr/lib/python2.4/locale.py", line 379, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

robertlin 发表于 2005-8-19 07:22:57

这是上面提到的文件:
File /usr/bin/yum内容:
#!/usr/bin/python
import sys
try:
   import yum
except ImportError:
   print >> sys.stderr, "The yum libraries do not seem to be available\
on your system for this version of python ", sys.version
   print >> sys.stderr, "Please make sure the package you used to install\
yum was built for your install of python."
   sys.exit(1)

sys.path.insert(0, '/usr/share/yum-cli')
try:
    import yummain
    yummain.main(sys.argv)
except KeyboardInterrupt, e:
    print >> sys.stderr, "\n\nExiting on user cancel."
    sys.exit(1)

robertlin 发表于 2005-8-19 07:23:43

#!/usr/bin/python -t
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Copyright 2005 Duke University


import os
import sys
import locale
import time # test purposes only

import yum
import yum.Errors as Errors
import cli


from i18n import _


def main(args):
    """This does all the real work"""

    locale.setlocale(locale.LC_ALL, '')
    # our core object for the cli
    base = cli.YumBaseCli()

    if len(args) < 1:
      base.usage()

    def unlock():
      try:
            base.closeRpmDB()
            base.doUnlock('/var/run/yum.pid')
      except Errors.LockError, e:
            sys.exit(200)

    # do our cli parsing and config file setup
    # also sanity check the things being passed on the cli
    try:
      base.getOptionsConfig(args)
    except Errors.YumBaseError, e:
      result = 1
      resultmsgs =
      for msg in resultmsgs:
            print >> sys.stderr, msg
      
      sys.exit(1)
      
    try:
      base.doLock('/var/run/yum.pid')
    except Errors.LockError, e:
      base.errorlog(0,'%s' % e.msg)
      sys.exit(200)

    # build up an idea of what we're supposed to do
    if base.basecmd == 'shell':
      do = base.doShell
    else:
      do = base.doCommands
    try:
      result, resultmsgs = do()
    except Errors, e:
      result = 1
      resultmsgs =
    except KeyboardInterrupt, e:
      base.errorlog(0, '\n\nExiting on user cancel')
      unlock()
      sys.exit(1)
    except IOError, e:
      if e.errno == 32:
            base.errorlog(0, '\n\nExiting on Broken Pipe')
      unlock()
      sys.exit(1)
            
    if result not in :
      base.errorlog(0, 'Unknown Error(s): Exit Code: %d:' % result)
      for msg in resultmsgs:
            base.errorlog(0, msg)
      unlock()
      sys.exit(3)
   
    if result == 100:
      unlock()
      sys.exit(100)

    elif result == 0:
      for msg in resultmsgs:
            base.log(2, '%s' % msg)
      unlock()
      sys.exit(0)
            
    elif result == 1:
      for msg in resultmsgs:
            base.errorlog(0, 'Error: %s' % msg)
      unlock()
      sys.exit(1)
            
    # Depsolve stage
    base.log(2, 'Resolving Dependencies')
    base.log(3, time.time())
    try:
      (result, resultmsgs) = base.buildTransaction()
    except Errors.YumBaseError, e:
      result = 1
      resultmsgs =
    except KeyboardInterrupt, e:
      base.errorlog(0, '\n\nExiting on user cancel')
      unlock()
      sys.exit(1)
    except IOError, e:
      if e.errno == 32:
            base.errorlog(0, '\n\nExiting on Broken Pipe')
      unlock()
      sys.exit(1)
   
    if result not in :
      base.errorlog(0, 'Unknown Error(s): Exit Code: %d:' % result)
      for msg in resultmsgs:
            base.errorlog(0, msg)
      unlock()
      sys.exit(3)
      
    if result == 0:
      unlock()
      sys.exit(0)
            
    elif result == 1:
      for msg in resultmsgs:
            base.errorlog(0, 'Error: %s' % msg)
      unlock()
      sys.exit(1)

    base.log(2, '\nDependencies Resolved')
    base.log(3, time.time())

    # run the transaction
    try:
      base.doTransaction()
    except Errors.YumBaseError, e:
      base.errorlog(0, '%s' % e)
      unlock()
      sys.exit(1)
    except KeyboardInterrupt, e:
      base.errorlog(0, '\n\nExiting on user cancel')
      unlock()
      sys.exit(1)
    except IOError, e:
      if e.errno == 32:
            base.errorlog(0, '\n\nExiting on Broken Pipe')
      unlock()
      sys.exit(1)

    base.log(2, 'Complete!')
    unlock()
    sys.exit(0)
   
   
if __name__ == "__main__":
    #import hotshot
    #p = hotshot.Profile(os.path.expanduser("~/yum.prof"))
    #p.run('main(sys.argv)')
    #p.close()   
    try:
      main(sys.argv)
    except KeyboardInterrupt, e:
      print >> sys.stderr, "\n\nExiting on user cancel."
      sys.exit(1)
页: [1]
查看完整版本: FC4更新时出现错误,恳请朋友帮帮忙谢了!