码迷,mamicode.com
首页 > 数据库 > 详细

[Q&A]yum报错‘database disk image is malformed’

时间:2016-05-19 13:30:25      阅读:328      评论:0      收藏:0      [点我收藏+]

标签: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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!