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
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