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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • 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. dotnet build: Builds a .NET application and its dependencies
  2. Allow cronjobs to run by pam even if user password is expired
  3. initctl Command Examples in Linux
  4. dir Command Examples in Linux
  5. register_new_matrix_user: command not found
  6. cut Command Examples in Linux
  7. ssh-add: command not found
  8. What does refid value “.LOCL.” mean in NTP
  9. apparmor_status: command not found
  10. colordiff: A tool to colorize diff output

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright