WhitewaterFoundry / Fedora-Remix-for-WSL

Fedora Remix for Windows Subsystem for Linux.
Other
710 stars 51 forks source link

DB_VERSION_MISMATCH when attempting to manage packages #53

Closed 0xADD1E closed 4 years ago

0xADD1E commented 4 years ago

Describe the bug When attempting to install a package:

error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch
error: cannot open Packages index using db5 -  (-30969)
error: cannot open Packages database in /var/lib/rpm

To Reproduce

Unknown. I haven't been doing anything abnormal, so far as I know.

I also encountered this when attempting to upgrade from 30 to 31, but I opted to fix that by completely reinstalling the application. I would really rather not do that here.

Basic Troubleshooting Checklist

What other troubleshooting have you attempted?

# rpmdb --rebuilddb
error: failed to replace old database with new database!
error: replace files in /var/lib/rpm with files from /var/lib/rpmrebuilddb.1330 to recover

WLinux Version

1.31.5.0

Windows Build

10.0.18362

crramirez commented 4 years ago

Hello @0xADD1E

Try this

sudo dnf upgrade --refresh rpm glibc
sudo rm /var/lib/rpm/.rpm.lock
sudo dnf upgrade dnf

Regards

modzilla99 commented 4 years ago

Thanks! That resolves that issue!

0xADD1E commented 4 years ago
# dnf upgrade --refresh rpm glibc
...
Dependencies resolved.
Nothing to do.
Complete!

# rm /var/lib/rpm/.rpm.lock
# dnf upgrade dnf
...
Dependencies resolved.
Nothing to do.
Complete!

And then, attempting to install a new package succeeds. Was it really just the lockfile? or did the dnf commands do something that they're not mentioning?

If the former, do you think there's a case for this being an upstream issue with rpm's error messages?

0xADD1E commented 4 years ago

In either case, thank you for your help!

barnscott commented 4 years ago

Just for reference, I just encountered this same issue. Had not had issue since I installed FedoraRemix on this PC in Oct 2019. I updated my PC to 2004, upgraded to release 32, and issue began. Not sure exactly what caused it, but the same resolution fixed it.

crramirez commented 4 years ago

This error is really erratic, this happened to me once. We don't know how to reproduce it or which is the cause. We create a script called upgrade.sh that takes care of it. Just run it every time that you want to call dnf update or very time when you see this error.

Regards

astronomerdave commented 2 years ago

Following only @crramirez 's suggestion, still have the following (on CentOS Linux release 8.5.2111)

RPM: error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch
RPM: error: cannot open Packages index using db5 -  (-30969)
RPM: error: cannot open Packages database in /var/lib/rpm

but then after that, having run sudo rpmdb --rebuilddb it seems to work.

sereneshikari commented 14 hours ago

rpmdb --rebuilddb worked for me too, thanks! I didn't have to use sudo since I was already running as root