How to fix Error: rpmdb open failed on CentOS


Error rpmdb open failed on CentOS

Today, I want to install some packages on my CentOS 7 server. Unfortunately, i can’t do this. When I run the “yum update” command, I got this error message:

[root@tutorialspots ~]# yum install autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel
error: db5 error(28) from dbenv->open: No space left on device
error: cannot open Packages index using db5 - No space left on device (28)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:

Error: rpmdb open failed

or

[root@tutorialspots ~]# yum install autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel
error: db5 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages index using db5 - Resource temporarily unavailable (11)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:

Error: rpmdb open failed

How to fix this error:

Step 1: backup

mv /var/lib/rpm/__db* /tmp

Step 2:

yum clean all

If this step error, use this command

rpm --rebuilddb

Reboot your server.

Step 3:

yum update

Step 4:

rm -i /tmp/__db*

Result:

[root@tutorialspots ~]# rm -i /tmp/__db*
rm: remove regular file ‘/tmp/__db.001’? y
rm: remove regular file ‘/tmp/__db.002’? y
rm: remove regular file ‘/tmp/__db.003’? y

Leave a Reply