标签:yum
错误描述:
在yum安装软件的过程中使用 Ctrl + c 组合键取消安装,之后再使用yum时报错:
Error: database disk image is malformed
例如:
[test@localhost etc]$ yum repolist
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: mirrors.yun-idc.com
* extras: mirrors.yun-idc.com
* updates: mirrors.yun-idc.com
Error: database disk image is malformed
解决方法:
以root用户执行 yum clean dbcache
×××××××××××××××××××××××××××××××××××××××××××××
1.测试使用普通用户执行 yum clean dbcache 命令无效
[test@localhost etc]$ yum clean dbcache
Loaded plugins: fastestmirror, security
Cleaning repos: base extras updates
4 sqlite files removed
[test@localhost etc]$ yum repolist
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: mirrors.yun-idc.com
* extras: mirrors.yun-idc.com
* updates: mirrors.yun-idc.com
Error: database disk image is malformed
2.测试使用sudo无效
[test@localhost etc]$ sudo yum clean dbcache
[sudo] password for test:
Loaded plugins: fastestmirror, security
Cleaning repos: base extras updates
5 sqlite files removed
[test@localhost etc]$ yum repolist
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: mirrors.yun-idc.com
* extras: mirrors.yun-idc.com
* updates: mirrors.yun-idc.com
Error: database disk image is malformed
3.切换到root用户再执行,成功
[test@localhost etc]$ su -
Password:
[root@localhost ~]# yum clean dbcache
Loaded plugins: fastestmirror, security
Cleaning repos: base extras updates
0 sqlite files removed
[root@localhost ~]# yum repolist
Loaded plugins: fastestmirror, security
Determining fastest mirrors
* base: mirrors.yun-idc.com
* extras: mirrors.yun-idc.com
* updates: mirrors.yun-idc.com
base/primary_db | 4.6 MB 00:09
extras/primary_db | 37 kB 00:00
updates/primary_db | 5.2 MB 00:11
repo id repo name status
base CentOS-6 - Base 6,575
extras CentOS-6 - Extras 62
updates CentOS-6 - Updates 1,622
repolist: 8,259
[root@localhost ~]#
本文出自 “junight” 博客,请务必保留此出处http://junight.blog.51cto.com/10828785/1774968
[Q&A]yum报错‘database disk image is malformed’
标签:yum
原文地址:http://junight.blog.51cto.com/10828785/1774968