yum报错:error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
- 2021-11-08 18:02:00
- IDO老徐 原创
- 9692
1、Linux服务器 ,执行 yum命令,报错,如下:
[root@isTester-Idoxu ~]# yum install nodejs
error: rpmdb: BDB0113 Thread/process 19512/140292738050112 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 - (-30973)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
2、原因:
rpm数据库被损坏了。
3、解决办法:
修改一下数据库即可,
1)执行命令cd /var/lib/rpm
[root@isTester-Idoxu ~]# cd /var/lib/rpm
[root@isTester-Idoxu rpm]# ls
Basenames Conflictname __db.001 __db.002 __db.003 Dirnames Group Installtid Name Obsoletename Packages Providename Requirename Sha1header Sigmd5 Triggername
2)查看
[root@isTester-Idoxu rpm]# ll
total 142484
-rw-r--r--. 1 root root 3051520 Nov 4 2020 Basenames
-rw-r--r--. 1 root root 16384 Oct 30 2020 Conflictname
-rw-r--r-- 1 root root 286720 Nov 8 17:55 __db.001
-rw-r--r-- 1 root root 90112 Nov 8 17:55 __db.002
-rw-r--r-- 1 root root 1318912 Nov 8 17:55 __db.003
-rw-r--r--. 1 root root 2072576 Nov 4 2020 Dirnames
-rw-r--r--. 1 root root 20480 Nov 4 2020 Group
-rw-r--r--. 1 root root 16384 Nov 4 2020 Installtid
-rw-r--r--. 1 root root 36864 Nov 4 2020 Name
-rw-r--r--. 1 root root 16384 Nov 2 2020 Obsoletename
-rw-r--r--. 1 root root 136822784 Nov 4 2020 Packages
-rw-r--r--. 1 root root 1888256 Nov 4 2020 Providename
-rw-r--r--. 1 root root 253952 Nov 4 2020 Requirename
-rw-r--r--. 1 root root 73728 Nov 4 2020 Sha1header
-rw-r--r--. 1 root root 40960 Nov 4 2020 Sigmd5
-rw-r--r--. 1 root root 8192 Oct 30 2020 Triggername
3)删除损害的数据库文件
[root@isTester-Idoxu rpm]# rm -rf __db.00*
[root@isTester-Idoxu rpm]# ll
total 140964
-rw-r--r--. 1 root root 3051520 Nov 4 2020 Basenames
-rw-r--r--. 1 root root 16384 Oct 30 2020 Conflictname
-rw-r--r--. 1 root root 2072576 Nov 4 2020 Dirnames
-rw-r--r--. 1 root root 20480 Nov 4 2020 Group
-rw-r--r--. 1 root root 16384 Nov 4 2020 Installtid
-rw-r--r--. 1 root root 36864 Nov 4 2020 Name
-rw-r--r--. 1 root root 16384 Nov 2 2020 Obsoletename
-rw-r--r--. 1 root root 136822784 Nov 4 2020 Packages
-rw-r--r--. 1 root root 1888256 Nov 4 2020 Providename
-rw-r--r--. 1 root root 253952 Nov 4 2020 Requirename
-rw-r--r--. 1 root root 73728 Nov 4 2020 Sha1header
-rw-r--r--. 1 root root 40960 Nov 4 2020 Sigmd5
-rw-r--r--. 1 root root 8192 Oct 30 2020 Triggername
4)重新创建数据库文件
[root@isTester-Idoxu rpm]# rpm --rebuilddb
[root@isTester-Idoxu rpm]# yum
Loaded plugins: fastestmirror, langpacks
You need to give some command
Usage: yum [options] COMMAND
List of Commands:
check Check for problems in the rpmdb
check-update Check for available package updates
clean Remove cached data
deplist List a package's dependencies
distribution-synchronization Synchronize installed packages to the latest available versions
downgrade downgrade a package
erase Remove a package or packages from your system
fs Acts on the filesystem data of the host, mainly for removing docs/lanuages for minimal hosts.
fssnapshot Creates filesystem snapshots, or lists/deletes current snapshots.
groups Display, or use, the groups information
help Display a helpful usage message
history Display, or use, the transaction history
info Display details about a package or group of packages
install Install a package or packages on your system
langavailable Check available languages
langinfo List languages information
langinstall Install appropriate language packs for a language
langlist List installed languages
langremove Remove installed language packs for a language
list List a package or groups of packages
load-transaction load a saved transaction from filename
makecache Generate the metadata cache
provides Find what package provides the given value
reinstall reinstall a package
repo-pkgs Treat a repo. as a group of packages, so we can install/remove all of them
repolist Display the configured software repositories
search Search package details for the given string
shell Run an interactive yum shell
swap Simple way to swap packages, instead of using shell
update Update a package or packages on your system
update-minimal Works like upgrade, but goes to the 'newest' package match which fixes a problem that affects your system
updateinfo Acts on repository update information
upgrade Update packages taking obsoletes into account
version Display a version for the machine and/or available repos.
Options:
-h, --help show this help message and exit
-t, --tolerant be tolerant of errors
-C, --cacheonly run entirely from system cache, don't update cache
-c [config file], --config=[config file]
config file location
-R [minutes], --randomwait=[minutes]
maximum command wait time
-d [debug level], --debuglevel=[debug level]
debugging output level
--showduplicates show duplicates, in repos, in list/search commands
-e [error level], --errorlevel=[error level]
error output level
--rpmverbosity=[debug level name]
debugging output level for rpm
-q, --quiet quiet operation
-v, --verbose verbose operation
-y, --assumeyes answer yes for all questions
--assumeno answer no for all questions
--version show Yum version and exit
--installroot=[path] set install root
--enablerepo=[repo] enable one or more repositories (wildcards allowed)
--disablerepo=[repo] disable one or more repositories (wildcards allowed)
-x [package], --exclude=[package]
exclude package(s) by name or glob
--disableexcludes=[repo]
disable exclude from main, for a repo or for
everything
--disableincludes=[repo]
disable includepkgs for a repo or for everything
--obsoletes enable obsoletes processing during updates
--noplugins disable Yum plugins
--nogpgcheck disable gpg signature checking
--disableplugin=[plugin]
disable plugins by name
--enableplugin=[plugin]
enable plugins by name
--skip-broken skip packages with depsolving problems
--color=COLOR control whether color is used
--releasever=RELEASEVER
set value of $releasever in yum config and repo files
--downloadonly don't update, just download
--downloaddir=DLDIR specifies an alternate directory to store packages
--setopt=SETOPTS set arbitrary config and repo options
--bugfix Include bugfix relevant packages, in updates
--security Include security relevant packages, in updates
--advisory=ADVS, --advisories=ADVS
Include packages needed to fix the given advisory, in
updates
--bzs=BZS Include packages needed to fix the given BZ, in
updates
--cves=CVES Include packages needed to fix the given CVE, in
updates
--sec-severity=SEVS, --secseverity=SEVS
Include security relevant packages matching the
severity, in updates
Plugin Options:
5)查看是否创建成功
[root@isTester-Idoxu rpm]# ll
total 86052
-rw-r--r-- 1 root root 2846720 Nov 8 17:58 Basenames
-rw-r--r-- 1 root root 8192 Nov 8 17:58 Conflictname
-rw-r--r-- 1 root root 286720 Nov 8 17:58 __db.001
-rw-r--r-- 1 root root 90112 Nov 8 17:58 __db.002
-rw-r--r-- 1 root root 57344 Nov 8 17:58 __db.003
-rw-r--r-- 1 root root 1327104 Nov 8 17:58 Dirnames
-rw-r--r-- 1 root root 24576 Nov 8 17:58 Group
-rw-r--r-- 1 root root 16384 Nov 8 17:58 Installtid
-rw-r--r-- 1 root root 40960 Nov 8 17:58 Name
-rw-r--r-- 1 root root 16384 Nov 8 17:58 Obsoletename
-rw-r--r-- 1 root root 81248256 Nov 8 17:58 Packages
-rw-r--r-- 1 root root 1957888 Nov 8 17:58 Providename
-rw-r--r-- 1 root root 217088 Nov 8 17:58 Requirename
-rw-r--r-- 1 root root 69632 Nov 8 17:58 Sha1header
-rw-r--r-- 1 root root 45056 Nov 8 17:58 Sigmd5
-rw-r--r-- 1 root root 8192 Nov 8 17:58 Triggername
搞定 。
推荐阅读 :软件测试25条职业发展方向 / 21天搞定Linux / Linux部署 / 600位测试工程师现状
1. 所有文章,均为IDO老徐原创(免费学习,欢迎收藏、转发),博客地址 isTester.com
2. 顶部菜单,按栏目查询,可快速检索你需要的所有文章 。看完文章还有不明白的,微信联系 IDO老徐
100 个实战小项目,少亏钱,多赚钱
送《一人企业复利商业化》实体书(包邮)
365 * 24 随时向 IDO老徐 免费提问
微信 957863300
- 软件测试从业者知识体系大纲(脑图)
- 软件测试工程师需要掌握的SQL命令合集(21天掌握)
- 电子书:软件测试综合能力提升@IDO老徐
- 如何选择一台适合日常学习的Linux云服务器 ?
- Centos 下mysql数据库完整安装过程
- 所有你要的软件测试资料打包送上(最新)
- 21天,搞定软件测试从业者必备的Linux命令(完整篇)
- Linux 下 部署 禅道(zentao)项目管理系统
- Mysql安装,解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- git 查看本地仓库,对应的“远程仓库地址”
想了解更多 ?
所有原创软件测试文章都在这
有近10W 软件测试工程师关注
助力「软件测试从业者综合能力提升」
关注后,回复 666 有惊喜
长按/扫码 关注@简尚
我的个人微信 957863300
IDO老徐
全网同名,个人IP公众号
日更10年,每天 1 分钟、解决 1 个问题
职场、副业、轻创业、写作、个人IP
公众号、视频号、小红书、知乎
长按/扫码,关注IDO老徐
关注回复 401 送你一份资料包
联系人: | IDO老徐 |
---|---|
Email: | 957863300@qq.com |
QQ: | 957863300 |
微信: | 957863300 |
微博: | isTester |
网址: | isTester.com |
地址: | 中国 · 广东 · 深圳 |