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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Q&A]yum报错‘database disk image is malformed’相关的知识,希望对你有一定的参考价值。

错误描述:

在yum安装软件的过程中使用 Ctrl + c 组合键取消安装,之后再使用yum时报错:

Error: database disk image is malformed


例如:

[[email protected] 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 命令无效

[[email protected] etc]$ yum clean dbcache

Loaded plugins: fastestmirror, security

Cleaning repos: base extras updates

4 sqlite files removed

[[email protected] 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无效

[[email protected] etc]$ sudo yum clean dbcache

[sudo] password for test:

Loaded plugins: fastestmirror, security

Cleaning repos: base extras updates

5 sqlite files removed

[[email protected] 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用户再执行,成功

[[email protected] etc]$ su -

Password:

[[email protected] ~]# yum clean dbcache

Loaded plugins: fastestmirror, security

Cleaning repos: base extras updates

0 sqlite files removed

[[email protected] ~]# 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

[[email protected] ~]#


本文出自 “junight” 博客,请务必保留此出处http://junight.blog.51cto.com/10828785/1774968

以上是关于[Q&A]yum报错‘database disk image is malformed’的主要内容,如果未能解决你的问题,请参考以下文章

Yum database disk image is malformed 错误 解决办法

database disk image is malformed

[故障解决]Error: database disk image is malformed怎么办?

yum install 报错BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch

zookeeper 无法启动 ERROR org.apache.zookeeper.server.quorum.QuorumPeer: Unable to load database on disk

mysql数据库崩溃:InnoDB: Database page corruption on disk or a failed