Yum Update Error 'rpmdb', Insufficient Space
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
- 原文作者:春江暮客
- 原文链接:https://www.bobobk.com/en/305.html
- 版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议进行许可,非商业转载请注明出处(作者,原文链接),商业转载请联系作者获得授权。