麒麟操作系统(v10)yum安装服务提示以下报错:
[root@master1 ~]# yum -y install nfs-util
e**rror:** rpmdb: BDB2034 unable to allocate memory for mutex; resize mutex region
error: cannot open Packages index using db5 - Cannot allocate memory (12)
error: cannot open Packages database in /var/lib/rpm
Error: Error: rpmdb open failed
解决办法:
#切换目录
[root@master1 rpm]# cd /var/lib/rpm
[root@master1 rpm]# ll
total 36972
-rw-r--r-- 1 root root 4030464 Aug 7 16:52 Basenames
-rw-r--r-- 1 root root 32768 Aug 7 16:52 Conflictname
-rw------- 1 root root 352256 Aug 7 16:52 __db.001
-rw------- 1 root root 90112 Aug 7 16:52 __db.002
-rw------- 1 root root 1318912 Aug 7 16:52 __db.003
-rw-r--r-- 1 root root 1703936 Aug 7 16:52 Dirnames
-rw-r--r-- 1 root root 32768 Aug 7 16:50 Enhancename
-rw-r--r-- 1 root root 32768 Aug 7 16:50 Filetriggername
-rw-r--r-- 1 root root 49152 Aug 7 16:52 Group
-rw-r--r-- 1 root root 49152 Aug 7 16:52 Installtid
-rw-r--r-- 1 root root 65536 Aug 7 16:52 Name
-rw-r--r-- 1 root root 65536 Aug 7 16:52 Obsoletename
-rw-r--r-- 1 root root 25411584 Aug 7 16:52 Packages
-rw-r--r-- 1 root root 376832 Aug 7 16:52 Providename
-rw-r--r-- 1 root root 32768 Aug 7 16:50 Recommendname
-rw-r--r-- 1 root root 376832 Aug 7 16:52 Requirename
-rw-r--r-- 1 root root 98304 Aug 7 16:52 Sha1header
-rw-r--r-- 1 root root 65536 Aug 7 16:52 Sigmd5
-rw-r--r-- 1 root root 32768 Aug 7 16:50 Suggestname
-rw-r--r-- 1 root root 32768 Aug 7 16:50 Supplementname
-rw-r--r-- 1 root root 32768 Aug 7 16:50 Transfiletriggername
-rw-r--r-- 1 root root 32768 Aug 7 16:52 Triggername
#删除库文件
[root@master1 rpm]# rm __db.* -f
#重建库文件
[root@master1 rpm]# rpm --rebuilddb
#清理文件、重建缓存
[root@master1 rpm]# yum clean all
17 files removed
[root@master1 rpm]# yum makecache
Kylin Linux Advanced Server 10 - Os 1.3 MB/s | 10 MB 00:07
loudong 834 kB/s | 609 kB 00:00
loudong2 1.4 MB/s | 20 MB 00:14
Last metadata expiration check: 0:00:01 ago on Wed 07 Aug 2024 04:50:40 PM CST.
Metadata cache created.
[root@master1 rpm]#
`在删除 BDB 文件前,最好先备份这些文件,以防万一重建过程中出现问题,可以从备份中恢复 `