• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Yum Fails with “Error: database disk image is malformed” in /var/log/messages

by admin

The Problem

Unable to execute any command related to yum and below error messages found in /var/log/messages file. For example:

# yum update
Loaded plugins: aliases, changelog, downloadonly, kabi, presto, refresh-packagekit, security, tmprepo, verify, versionlock
Loading support for kernel ABI
Setting up Install Process
Ol6_latest | 3.0 kB 00:00
Ol6_latest/primary_db | 78 MB 00:10

[Errno 2] No such file or directory: '/var/cache/yum/x86_64/6Server/Ol6_latest/primary.sqlite.bz2'
Loaded plugins: aliases, changelog, downloadonly, kabi, presto, refresh-packagekit, security, tmprepo, verify, versionlock
Loading support for kernel ABI
Setting up Update Process
Ol6_latest/primary_db | 78 MB 00:10
Resolving Dependencies
--> Running transaction check
---> Package expat.x86_64 0:2.0.1-11.el6_2 will be updated
Error: database disk image is malformed

The Solution

The common reason for this error is yum misconfiguration or yum related DB corruption. Follow the steps below in order to resolve the issue:

1. Check and delete any unwanted or wrongly configured files under the path /etc/yum.repos.d.

2. Run “yum clean all” command.

# yum clean all

3. Now try to perform “yum update”:

# yum update

Filed Under: Linux

Some more articles you might also be interested in …

  1. du Command Examples in Linux
  2. How to Connect Remote Host Using the ssh Command
  3. How to Force ASM to Scan the Multipathed Device First using ASMLIB/oracleasm
  4. virt-manager: command not found
  5. dracut: command not found
  6. net-snmp-create-v3-user: command not found
  7. What is Anacron and usage of Anacron in Linux
  8. How to monitor /etc/shadow and /etc/passwd file for changes with Auditd?
  9. cut: command not found
  10. How to make a LED flash with the Raspberry Pi

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright