3 de out. de 2020

Fix rpmdb: Thread died in Berkeley DB library [CentOS 8]

Fix rpmdb: Thread died in Berkeley DB library [CentOS 8]

Sintomas

Se você vir erros de rpmdb durante o gerenciamento de pacotes (durante as operações yum / rpm), como este:


[root@a-node ~]# yum clean all
Failed to set locale, defaulting to C.UTF-8
error: rpmdb: BDB0113 Thread/process 2456/140690658715456 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
Error: Error: rpmdb open failed
[root@a-node ~]# yum make cache
Failed to set locale, defaulting to C.UTF-8
error: rpmdb: BDB0113 Thread/process 2456/140690658715456 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


Isso significa que o banco de dados RPM está corrompido.

Solução

Siga estas etapas para fazer backup e reconstruir o banco de dados rpmdb:

[root@a-node ~]# mkdir /var/lib/rpm/backup
[root@a-node ~]# cp -a /var/lib/rpm/__db* /var/lib/rpm/backup/
[root@a-node ~]# rm -f /var/lib/rpm/__db.[0-9][0-9]*
[root@a-node ~]# rpm --quiet -qa
[root@a-node ~]# rpm --rebuilddb
error: could not delete old database at /var/lib/rpmold.2590
[root@a-node ~]# rpm --rebuilddb
[root@a-node ~]# yum clean all
Failed to set locale, defaulting to C.UTF-8
26 files removed
[root@a-node ~]# dnf install mariadb
Failed to set locale, defaulting to C.UTF-8
CentOS-8 - AppStream                                                    2.1 MB/s | 5.8 MB     00:02    
CentOS-8 - Base                                                         541 kB/s | 2.2 MB     00:04    
CentOS-8 - Extras                                                        11 kB/s | 8.1 kB     00:00    
Last metadata expiration check: 0:00:01 ago on Sat Oct  3 15:57:20 2020.
Package mariadb-3:10.3.17-1.module_el8.1.0+257+48736ea6.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!







Nenhum comentário:

Postar um comentário