rpm issues with /var/lib/rpm/Packages

Latest response

My /var/lib/rpm/Packages got corrupted.

I have tried to follow this tutorial to fix it.

https://access.redhat.com/solutions/6903

It acts like it works but when I try to install a package I am not able to.

root@server1 /var/lib/rpm:>rm -f __db*
root@server1 /var/lib/rpm:>rpm -vv --rebuilddb
D: rebuilding database /var/lib/rpm into /var/lib/rpmrebuilddb.59659
D: opening db environment /var/lib/rpm private:0x401
D: opening db index /var/lib/rpm/Packages 0x400 mode=0x0
D: locked db index /var/lib/rpm/Packages
D: opening db environment /var/lib/rpmrebuilddb.59659 private:0x401
D: opening db index /var/lib/rpmrebuilddb.59659/Packages (none) mode=0x42
D: opening db index /var/lib/rpmrebuilddb.59659/Packages 0x1 mode=0x42
D: disabling fsync on database
D: closed db index /var/lib/rpm/Packages
D: closed db environment /var/lib/rpm
D: closed db index /var/lib/rpmrebuilddb.59659/Packages
D: closed db environment /var/lib/rpmrebuilddb.59659
root@server1 /var/lib/rpm:>yum install man
CRITICAL:yum.main:

Error: rpmdb failed release provides. Try: rpm --rebuilddb

Responses

Have a Red Hat 7 server with the same issue, any update on this?

Did you zero out the file? If you did your options are restore from backup, copy from another server, or reinstall the the server.

I ended up being able resolve this issue. Turned out that the /etc/rpm/vars file was missing the entry for releasever. Once I entered 7, I was finally able to run yum update without issue.