使用更新命令yum时出现故障的解决方法

redhatlinux 2021-08-06 原文

近日在运行系统更新命令yum update时候出现了如下错误提示:
Component: pirut
Summary: TBe8ae967a sqlitesack.py:94:_read_db_obj:TypeError: unsubscriptable object

Traceback (most recent call last):
  File “/usr/sbin/pup”, line 407, in _apply
    output = self.applyChanges(self.mainwin)
  File “/usr/lib/python2.4/site-packages/pirut/__init__.py”, line 813, in applyChanges
    self.checkDeps(mainwin)
  File “/usr/lib/python2.4/site-packages/pirut/__init__.py”, line 550, in checkDeps
    (result, msgs) = self.buildTransaction()
  File “/usr/lib/python2.4/site-packages/yum/__init__.py”, line 647, in buildTransaction
    (rescode, restring) = self.resolveDeps()
  File “/usr/lib/python2.4/site-packages/yum/depsolve.py”, line 704, in resolveDeps
    for po, dep in self._checkFileRequires():
  File “/usr/lib/python2.4/site-packages/yum/depsolve.py”, line 939, in _checkFileRequires
    if not self.tsInfo.getOldProvides(filename) and not self.tsInfo.getNewProvides(filename):
  File “/usr/lib/python2.4/site-packages/yum/transactioninfo.py”, line 414, in getNewProvides
    for pkg, hits in self.pkgSack.getProvides(name, flag, version).iteritems():
  File “/usr/lib/python2.4/site-packages/yum/packageSack.py”, line 300, in getProvides
    return self._computeAggregateDictResult(“getProvides”, name, flags, version)
  File “/usr/lib/python2.4/site-packages/yum/packageSack.py”, line 470, in _computeAggregateDictResult
    sackResult = apply(method, args)
  File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 861, in getProvides
    return self._search(“provides”, name, flags, version)
  File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 43, in newFunc
    return func(*args, **kwargs)
  File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 837, in _search
    for pkg in self.searchFiles(name, strict=True):
  File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 43, in newFunc
    return func(*args, **kwargs)
  File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 586, in searchFiles
    self._sql_pkgKey2po(rep, cur, pkgs)
  File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 470, in _sql_pkgKey2po
    pkg = self._packageByKey(repo, ob[\’pkgKey\’])
  File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 413, in _packageByKey
    po = self.pc(repo, cur.fetchone())
  File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 68, in __init__
    self._read_db_obj(db_obj)
  File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 94, in _read_db_obj
    setattr(self, item, _share_data(db_obj[item]))
TypeError: unsubscriptable object

Local variables in innermost frame:
item: name
db_obj: None

这个问题是由于yum的原数据损坏导致的,需要先删除原数据和数据库缓存,然后重建,问题即可解决
解决方法,依次运行以下命令:

yum clean metadata
yum clean dbcache
yum makecache

版权声明:本文为redhatlinux原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/redhatlinux/archive/2012/03/29/2423691.html

使用更新命令yum时出现故障的解决方法的更多相关文章

随机推荐

  1. Java开源生鲜电商平台-安全设计与架构(源码可下载)

    Java开源生鲜电商平台-安全设计与架构(源码可下载) 说明:Java开源生鲜电商平台是一个B2B的生鲜电商平 […]...

  2. teamviewer连接不上的原因及解决方法有哪些

    teamviewer连接不上的原因及解决方法有哪些 一、总结 一句话总结:这里说的就是版本问题,高版本可以连接 […]...

  3. 《欲望的演化》总结

    这本书是《进化心理学》的作者写的,可以理解为阉割版,可以看成《进化心理学》择偶章节的扩展。 大致就是从生物学的 […]...

  4. java web 获取 网页访问次数

    ServletContext context = request.getServletContext();/* […]...

  5. 图片跨域规律探寻

    先说结论: canvas.toDataURL API中用到的图片,必须添加crossOrigin属性设置,否则 […]...

  6. 执行py文件需要可执行权限吗?

    我们知道可执行权限x在Linux系统中的重要性,那么在执行py文件的过程中,是否一定需要可执行权限呢?本文将会 […]...

  7. 笔记本光驱位置装SSD固态硬盘(亲自试验)

    我的笔记本买的早了,2010年的联想Z460,速度有点慢,本来想换台电脑,想想还是算了,没有太大必要。固态硬盘 […]...

  8. 聊聊程序员的核心能力

    随着互联网和移动互联网的快速发展,各类应用软件(app)如雨后春笋般涌现,许多应用程序甚至成为超级app,一些 […]...

展开目录

目录导航