yum error: cannot open Packages database in /var/lib/rpm

发布时间:2020-07-21 21:38:34 作者:Benyod
来源:网络 阅读:1461


1、前提条件:安装软件包的时候,被我手动终止了
[root@dhcp yum.repos.d]# yum clean all
rpmdb: Thread/process 4541/140619363587840 failed: Thread died in Berkeley DB library
error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 -  (-30974)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
[root@dhcp yum.repos.d]# yum makecache
rpmdb: Thread/process 4541/140619363587840 failed: Thread died in Berkeley DB library
error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 -  (-30974)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:

 

2、根据提示可以知道rpm数据库被损坏,如是按照下面的方法进行重建
[root@dhcp yum.repos.d]# cd /var/lib/rpm/
[root@dhcp rpm]# ls
Basenames     __db.004     Name            Pubkeys         Triggername
Conflictname  Dirnames     Obsoletename    Requirename
__db.001      Filedigests  Packages        Requireversion
__db.002      Group        Providename     Sha1header
__db.003      Installtid   Provideversion  Sigmd5
[root@dhcp rpm]# rm __db.* -rf
[root@dhcp rpm]# rpm --rebuilddb

[root@dhcp rpm]# yum clean all
Loaded plugins: aliases, changelog, downloadonly, kabi, presto, product-id,
              : refresh-packagekit, security, subscription-manager, tmprepo,
              : verify, versionlock
Updating certificate-based repositories.
Unable to read consumer identity
Loading support for Red Hat kernel ABI
Cleaning repos: rhel-source
Cleaning up Everything
0 delta-package files removed, by presto
[root@dhcp rpm]# yum update
Loaded plugins: aliases, changelog, downloadonly, kabi, presto, product-id,
              : refresh-packagekit, security, subscription-manager, tmprepo,
              : verify, versionlock
Updating certificate-based repositories.
Unable to read consumer identity
Loading support for Red Hat kernel ABI
rhel-source                                                | 4.0 kB     00:00 ...
rhel-source/primary_db                                     | 3.1 MB     00:00 ...
Setting up Update Process
No Packages marked for Update



推荐阅读:
  1. linux中rpm、yum与源码安装软件的详解
  2. Linux yum如何卸载软件?

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

yum dat rp

上一篇:android基础知识之服务

下一篇:Spring 核心技术与产品理念剖析【下】

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》