BOBOBK

Yum Update Error 'rpmdb', Insufficient Space

MISCELLANEOUS

1. Error: rpmdb open failed

When logged into Linux and using yum update -y, I encountered the error Error: rpmdb open failed.

This error occurs because the RPM database is corrupted. We can resolve this by rebuilding the database, after which it should return to normal. Here’s the code:

cd /var/lib/rpm/
for i in `ls | grep 'db.'`;do mv $i $i.bak;done
rpm --rebuilddb
yum clean all

2. Insufficient Space Error After Rebuilding

To fix this, you’ll need to free up space by deleting older kernel versions, then proceed with the update. Here’s the code:

yum list kernel # View installed kernels
package-cleanup --oldkernels --count=2 # Keep only 2 kernels

To prevent this error from occurring again, add the following configuration to /etc/yum.conf: Set installonly_limit=2

Related