centos7 yum update 出错

centos7 yum update 出错

我们在 centos7 中安装或更新 yum 软件包时遇到错误。它是 centos7 openVZ 服务器。有人能帮忙解决这个问题吗?

Running transaction
Traceback (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 365, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 271, in main
    return_code = base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 773, in doTransaction
    resultobject = self.runTransaction(cb=cb)
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1798, in runTransaction
    lastdbv = self.history.last()
  File "/usr/lib/python2.7/site-packages/yum/history.py", line 1268, in last
    ret = self.old([], 1, complete_transactions_only)
  File "/usr/lib/python2.7/site-packages/yum/history.py", line 1217, in old
    executeSQL(cur, sql, params)
  File "/usr/lib/python2.7/site-packages/yum/sqlutils.py", line 166, in executeSQLQmark
    return cursor.execute(query)
sqlite3.OperationalError: no such table: trans_beg

答案1

此错误表明您的历史数据库已损坏yum。请参阅此错误报告:

https://bugzilla.redhat.com/show_bug.cgi?id=699041

该报告提出了两条可能的建议:

  1. 该命令yum history new可能会通过构建新的历史记录文件来解决问题。缺点是该命令将重置您的yum历史记录。

  2. 您可以尝试从中删除一些历史文件/var/lib/yum/history,这会将您的历史记录恢复到较早的日期。

相关内容