记录一个Redhat7下关于yum的问题

系统重启后准备使用yum命令安装一个软件包,但是在安装的过程中出现如图所示错误:

[root@coisini ~]# yum install -y tree
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package tree.x86_64 0:1.6.0-10.el7 will be installed
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 375, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 239, in main
    (result, resultmsgs) = base.buildTransaction() 
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1198, in buildTransaction
    (rescode, restring) = self.resolveDeps()
  File "/usr/lib/python2.7/site-packages/yum/depsolve.py", line 902, in resolveDeps
    for po, dep in self._checkFileRequires():
  File "/usr/lib/python2.7/site-packages/yum/depsolve.py", line 1193, in _checkFileRequires
    self.installedFileProviders = self.rpmdb.fileRequiresData()
  File "/usr/lib/python2.7/site-packages/yum/rpmsack.py", line 994, in fileRequiresData
    rpmdbv = self.simpleVersion(main_only=True)[0]
  File "/usr/lib/python2.7/site-packages/yum/rpmsack.py", line 1228, in simpleVersion
    if 'checksum_type' in ydbi and 'checksum_data' in ydbi:
  File "/usr/lib/python2.7/site-packages/yum/rpmsack.py", line 1949, in __contains__
    x = self.get(attr)
  File "/usr/lib/python2.7/site-packages/yum/rpmsack.py", line 1979, in get
    res = self._read(attr)
  File "/usr/lib/python2.7/site-packages/yum/rpmsack.py", line 1885, in _read
    info = misc.stat_f(fn, ignore_EACCES=True)
  File "/usr/lib/python2.7/site-packages/yum/misc.py", line 974, in stat_f
    return os.stat(filename)
OSError: [Errno 117] Structure needs cleaning: '/var/lib/yum/yumdb/y/c360c3efe4203eb7ee07d45808e61daa061f8742-yum-3.4.3-163.el7-noarch/checksum_type'

看到这个报错有点熟悉的感觉,仿佛之前遇到过,仔细想了好久,终于想到该怎样处理这个问题,在此也做个记录,

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页