I'm trying to tát lập cập yum update and I'm running this error:

rpmdb: PANIC: fatal region error detected; lập cập recovery
error: db3 error(-30974) from dbenv->open: DB_RUNRECOVERY: Fatal error, lập cập 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

I checked page lượt thích this one but running yum clean all runs the same error.

How can I solve this?

asked Apr 25, năm ngoái at 15:40

1

This is how I fixed my problem.

You may fix this by cleaning out rpm database. But first, in order to tát minimize the risk, make sure you create a backup of files in /var/lib/rpm/ using cp command:

mkdir /root/backups.rpm.mm_dd_yyyy/
cp -avr /var/lib/rpm/ /root/backups.rpm.mm_dd_yyyy/

The try this to tát fix this problem:

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

And finally verify that error has gone with the following yum command

# yum update

answered Apr 25, năm ngoái at 15:40

7

All I had to tát tự was to tát delete the two tệp tin with the ".lock" extension, and the three files that started with "__db".

# rm /var/lib/rpm/.dbenv.lock
# rm /var/lib/rpm/.rpm.lock
# rm /var/lib/rpm/__db*

After that, yum update worked.

answered Jan 17, 2019 at 19:00

Thanks Alex, your answer worked for bầm apart from one slight change I had to tát make.

rm -f /var/lib/rpm/__db*

returned errors

rm: cannot remove `/var/lib/rpm/__db.001': Is a directory
rm: cannot remove `/var/lib/rpm/__db.002': Is a directory
rm: cannot remove `/var/lib/rpm/__db.004': Is a directory

so I had to tát recurse with

rm -rf /var/lib/rpm/__db*

answered Jun 6, năm ngoái at 20:18

1

I tried the above one it did'nt work

below works fine

# cd /var/lib
# tar -zcvf /var/preserve/rpmdb-$(date +%Y-%m-%d_%H-%M-%S).tar.gz rpm

Note: This tar backup can be used if the attempt to tát recover the RPM database has issues.

Verify integrity of the Packages file:

# cd /var/lib/rpm
# rm -f __db*      # to tát avoid stale locks
# /usr/lib/rpm/rpmdb_verify Packages

# mv Packages Packages.orig
# /usr/lib/rpm/rpmdb_dump Packages.orig | /usr/lib/rpm/rpmdb_load Packages


# rpm -vv --rebuilddb

Once again verify RPM database:

# cd /var/lib/rpm
# /usr/lib/rpm/rpmdb_verify Packages

answered Apr 16, 2018 at 7:30

2

You must log in to tát answer this question.

Not the answer you're looking for? Browse other questions tagged

.