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

Fix lỗi ‘rpmdb: PANIC: fatal region error detected’ khi xài yum trên CentOS/RHELCuongquach.com | Bạn sử dụng hệ thống CentOS và thực hiện hoạt động cài đặt phần mềm thông qua ‘yum’ thì bỗng gặp phải lỗi ‘rpmdb: PANIC: fatal region error detected; run recovery‘ như sau :

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

Vậy làm sao để fix lỗi ‘rpmdb: PANIC: fatal region error detected’ trên hệ thống OS CentOS/RHEL

Thật ra thì đây là một tình huống khá phức tạp, nhưng bạn sẽ xử lý vấn đề này bằng cách xoá CSDL RPM và tiến hành rebuild lại CSDL RPM. Để giảm thiểu rủi ro thì ta nên tiến hành backup các file nằm trong thư mục /var/lib/rpm .

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

Tiến hành fix lỗi ‘rpmdb’ và rebuild rpm lại.

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

Tiếp theo ta xác thực lại lỗi trên đã được xử lý chưa.

# yum update

 Vậy là bạn đã hoàn tất việc fix lỗi ‘rpmdb: PANIC: fatal region error detected’ này.

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

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/

Quách Chí Cường: 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 !
Related Post