Fix lỗi ‘rpmdb: PANIC: fatal region error detected’ khi xài yum trên CentOS/RHEL

Fix error ‘rpmdb: PANIC: fatal region error detected’ when use yum on CentOS/RHEL

You are using CentOS/RHEL OS and perform some action with yum to install package through repository. Then you encounter this kind error ‘rpmdb: PANIC: fatal region error detected; run recovery’ :

rpmdb: PANIC: fatal region error detected; run recovery
error: db3 error(-30974) from dbenv->open: 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

How to fix errror ‘rpmdb: PANIC: fatal region error detected’ on CentOS/RHEL

This is messed case, but you can follow the way to fix it by cleaning out RPM DB and rebuild it. First of all, you need to backup some files in directory ‘/var/lib/rpm’.

# mkdir /backup/rpm.bk
# cp -avr /var/lib/rpm/ /backup/rpm.bk

Remove current files and rebuild rpm db.

# rm -f /var/lib/rpm/__db*
# db_verify /var/lib/rpm/Packages/
# rpm —rebuildb
# yum clean all

Finally, we need to verify the status of fixing.

# yum update

Ok, so that all the steps you need to do for fixing the error ‘rpmdb: PANIC: fatal region error detected’.

Nguồn: https://cuongquach.com/

1
2
Previous article[Ebook] Cyber Security – Analytics, Technology and Automation – Download PDF
Next article[Ebook] Hacker Highshool Series Lesson – Download PDF
Bạn đang theo dõi website "https://cuongquach.com/" nơi lưu trữ những kiến thức tổng hợp và chia sẻ cá nhân về Quản Trị Hệ Thống Dịch Vụ & Mạng, được xây dựng lại dưới nền tảng kinh nghiệm của bản thân mình, Quách Chí Cường. Hy vọng bạn sẽ thích nơi này !