Yum sqlite database disk image is malformed error
Posted October 29th, 2007 in Linux/Unix/BSD
When trying to install something this morning using yum on a CentOS 5 machine, I got the error message "_sqlite.DatabaseError: database disk image is malformed" as shown below:
$ yum install vsftpd
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
base 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 951 B 00:00
centosplus 100% |=========================| 951 B 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.main(sys.argv[1:])
File "/usr/share/yum-cli/yummain.py", line 94, in main
result, resultmsgs = base.doCommands()
File "/usr/share/yum-cli/cli.py", line 381, in doCommands
return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
File "/usr/share/yum-cli/yumcommands.py", line 134, in doCommand
return base.installPkgs(extcmds)
File "/usr/share/yum-cli/cli.py", line 539, in installPkgs
self.doRepoSetup()
File "/usr/share/yum-cli/cli.py", line 109, in doRepoSetup
self.doSackSetup(thisrepo=thisrepo)
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 341, in doSackSetup
self.pkgSack.excludeArchs(archlist)
File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 331, in excludeArchs
sack.excludeArchs(archlist)
File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 587, in excludeArchs
cur.execute(querystring)
File "/usr/lib/python2.4/site-packages/sqlite/main.py", line 244, in execute
self.rs = self.con.db.execute(SQL)
_sqlite.DatabaseError: database disk image is malformed
This is easy to fix by issuing the following command:
yum clean all
After running this I got the following message, and I was able to install software again using Yum:
Loading "installonlyn" plugin
Cleaning up Everything
This error could happen on any Linux distribution that uses Yum for package management, such as Red Hat Enterprise Linux, CentOS 5, Fedora and its derivatives.
Related posts:
- List installed packages with YUM (Tuesday, December 2nd 2008)
- Yum error Metadata file does not match checksum (Tuesday, November 27th 2007)
- Install Yum on openSUSE with Yast (Friday, November 23rd 2007)
- Install yum with rpm on CentOS (Tuesday, October 16th 2007)
Subscribe / Follow / Email / Bookmark / Share
Use the buttons below to subscribe to my RSS feed to be notified next time something is posted, share this post with others, or subscribe by email to have my posts sent in a daily email, follow me on Twitter or follow me on Facebook.
At least one new post is usually made every day. See my posting schedule for more details.
