LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 02-07-2018, 08:04 AM   #1
Ramanc51
LQ Newbie
 
Registered: May 2011
Posts: 8

Rep: Reputation: 0
sqlite3.DatabaseError: database disk image is malformed


I got following error while sudo dnf update my fedora26 64 bit

Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Traceback (most recent call last):
File "/bin/dnf", line 58, in <module>
main.user_main(sys.argv[1:], exit_code=True)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 179, in user_main
errcode = main(args)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 64, in main
return _main(base, args, cli_class, option_parser_class)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 99, in _main
return cli_run(cli, base)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 123, in cli_run
ret = resolving(cli, base)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 154, in resolving
base.do_transaction(display=displays)
File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 238, in do_transaction
super(BaseCli, self).do_transaction(display)
File "/usr/lib/python3.6/site-packages/dnf/base.py", line 781, in do_transaction
self._run_transaction(cb=cb)
File "/usr/lib/python3.6/site-packages/dnf/base.py", line 829, in _run_transaction
lastdbv = self.history.last()
File "/usr/lib/python3.6/site-packages/dnf/yum/history.py", line 1313, in last
ret = self.old([], 1, complete_transactions_only)
File "/usr/lib/python3.6/site-packages/dnf/yum/history.py", line 1262, in old
executeSQL(cur, sql, params)
File "/usr/lib/python3.6/site-packages/dnf/yum/sqlutils.py", line 167, in executeSQLQmark
return cursor.execute(query)
sqlite3.DatabaseError: database disk image is malformed

I tried all possible following commands but no use,

rm -f /var/lib/rpm/__db*
rpm –rebuilddb
yum clean all

dnf clean all
dnf clean dbcache
dnf makecache

could you help me resolve this error?
 
Old 02-07-2018, 09:04 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 20,545

Rep: Reputation: 5037Reputation: 5037Reputation: 5037Reputation: 5037Reputation: 5037Reputation: 5037Reputation: 5037Reputation: 5037Reputation: 5037Reputation: 5037Reputation: 5037
Quote:
Originally Posted by Ramanc51 View Post
I got following error while sudo dnf update my fedora26 64 bit
Code:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Traceback (most recent call last):
  File "/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 179, in user_main
    errcode = main(args)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 99, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 123, in cli_run
    ret = resolving(cli, base)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 154, in resolving
    base.do_transaction(display=displays)
  File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 238, in do_transaction
    super(BaseCli, self).do_transaction(display)
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 781, in do_transaction
    self._run_transaction(cb=cb)
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 829, in _run_transaction
    lastdbv = self.history.last()
  File "/usr/lib/python3.6/site-packages/dnf/yum/history.py", line 1313, in last
    ret = self.old([], 1, complete_transactions_only)
  File "/usr/lib/python3.6/site-packages/dnf/yum/history.py", line 1262, in old
    executeSQL(cur, sql, params)
  File "/usr/lib/python3.6/site-packages/dnf/yum/sqlutils.py", line 167, in executeSQLQmark
    return cursor.execute(query)
sqlite3.DatabaseError: database disk image is malformed
I tried all possible following commands but no use,

rm -f /var/lib/rpm/__db*
rpm –rebuilddb
yum clean all

dnf clean all
dnf clean dbcache
dnf makecache

could you help me resolve this error?
Did you try "sudo yum history new"?? One of the first suggestions from the Fedora forums.
 
Old 02-07-2018, 09:34 AM   #3
Ramanc51
LQ Newbie
 
Registered: May 2011
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
Did you try "sudo yum history new"?? One of the first suggestions from the Fedora forums.

Thanks, I got same error as follows

[raman@localhost ~]$ sudo yum history new
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/dnf/cli/commands/__init__.py", line 950, in _args2transaction_ids
transaction_ids.add(str2transaction_id(t))
File "/usr/lib/python3.6/site-packages/dnf/cli/commands/__init__.py", line 912, in str2transaction_id
transaction_id = int(s)
ValueError: invalid literal for int() with base 10: 'new'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/bin/yum", line 58, in <module>
main.user_main(sys.argv[1:], exit_code=True)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 179, in user_main
errcode = main(args)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 64, in main
return _main(base, args, cli_class, option_parser_class)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 95, in _main
cli.configure(list(map(ucd, args)), option_parser())
File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 892, in configure
self.command.configure()
File "/usr/lib/python3.6/site-packages/dnf/cli/commands/__init__.py", line 844, in configure
require_one_transaction_id_msg)
File "/usr/lib/python3.6/site-packages/dnf/cli/commands/__init__.py", line 953, in _args2transaction_ids
transact_ids_from_pkgname = self.output.history.search([t])
File "/usr/lib/python3.6/site-packages/dnf/yum/history.py", line 1525, in search
for row in self._yieldSQLDataList(npatterns, fields, ignore_case):
File "/usr/lib/python3.6/site-packages/dnf/yum/history.py", line 1454, in _yieldSQLDataList
executeSQL(cur, qsql, pat_data)
File "/usr/lib/python3.6/site-packages/dnf/yum/sqlutils.py", line 169, in executeSQLQmark
return cursor.execute(query, params)
sqlite3.DatabaseError: database disk image is malformed
 
Old 02-07-2018, 10:26 PM   #4
Ramanc51
LQ Newbie
 
Registered: May 2011
Posts: 8

Original Poster
Rep: Reputation: 0
Then as per guide on https://laracasts.com/discuss/channe...qlite-database

i deleted all files including sqlite file from /var/lib/dnf/history and /var/lib/dnf/yum, now my problem solved, update working, no sqlite3.DatabaseError: database disk image is malformed error, Thanks to laracasts team and it's member wodCZ.

Last edited by Ramanc51; 02-07-2018 at 10:30 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is the sqlite3 database file located for miniDLNA? sdowney717 Linux - Software 0 10-17-2017 01:45 PM
sending queries in sqlite3 database via c API batman4 Programming 1 09-06-2012 12:58 AM
[SOLVED] Sqlite Error: database disk image is malformed Lobinho Programming 7 10-07-2011 05:13 AM
Sqlite Database image malformed ravindranvasudevan Programming 6 08-10-2009 03:37 AM
zen-updater Error: database disk image is malformed mahantya SUSE / openSUSE 2 03-29-2007 06:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 03:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration