Sqlite eror - Disk I/O error

i truing to update or install some with dnf and see it

Please avoid screen shots of text.
You can copy the text and paste here as preformatted text using the </> button.

The disk I/O error may mean you have a hardware problem with your disk.
Do you have disk errors logged in the journal or output of sudo dmesg?

If you can use an English locale will make the messages readable by us English speakers.

1 Like

i wiil translate with translator

[14457.117596] I/O error, dev sda, sector 76706784 op 0x0:(READ) flags 0x0 phys_seg 3 prio class 2
[14457.117606] BTRFS error (device sda3): bdev /dev/sda3 errs: wr 0, rd 531, flush 0, corrupt 0, gen 0

History database is not writable: SQLite error on "/var/lib/dnf/history.sqlite": Executing an SQL statement failed: disk I/O error
History database is not writable: SQLite error on "/var/lib/dnf/history.sqlite": Executing an SQL statement failed: disk I/O error
error: SQLite error on "/var/lib/dnf/history.sqlite": Executing an SQL statement failed: disk I/O error

You can use LANG=C to temporarily switch to English for the command.
Also, -v option should provides additional details.

LANG=C sudo dnf update -yv

Last metadata expiration check: 0:16:14 ago on Tue Jul 30 09:48:08 2024.
--> Starting dependency resolution
History database is not writable: SQLite error on "/var/lib/dnf/history.sqlite": Executing an SQL statement failed: disk I/O error
---> Package kernel.x86_64 6.9.11-200.fc40 will be installed
History database is not writable: SQLite error on "/var/lib/dnf/history.sqlite": Executing an SQL statement failed: disk I/O error
Error: SQLite error on "/var/lib/dnf/history.sqlite": Executing an SQL statement failed: disk I/O error

This I/O error may be the cause, I think what you are experiencing with sqlite is just a sympton of the I/O errors.

The message indicates:

  • wr 0: No write errors.
  • rd 531: 531 read errors.
  • flush 0: No flush errors.
  • corrupt 0: No corruption errors.
  • gen 0: No generation errors.

I would start investigating by running a disk health check sudo smartctl -a /dev/sda

2 Likes

Added btrfs

sudo: smartctl: command not found
sudo dnf install smartmontools
Fedora 40 - x86_64 - Updates                                                                                                             42 kB/s |  27 kB     00:00    
Last metadata expiration check: 0:00:01 ago on Tue Jul 30 11:16:02 2024.
History database is not writable: SQLite error on "/var/lib/dnf/history.sqlite": Executing an SQL statement failed: disk I/O error
History database is not writable: SQLite error on "/var/lib/dnf/history.sqlite": Executing an SQL statement failed: disk I/O error
Error: SQLite error on "/var/lib/dnf/history.sqlite": Executing an SQL statement failed: disk I/O error

When you are asked to run a command and you see this error first try installing the command.

The dnf install can also be asked to install like this.

dnf install /usr/bin/smartctl

Now you can run the command and post the output.

If you have Fedora Workstation (GNOME), you probably have GNOME disk installed. From there, you can check the status of the disk.
Here’s a video guide on the procedure: https://youtu.be/8UGPopTGPmo?t=35

2 Likes

The point is exactly that @chr3ter can’t install anything.

1 Like

the status says : THE DISK MAY BREAK SOON (28C, 82F)

1 Like
Copr repo for PyCharm owned by phracek                                                                                                   58 kB/s | 108 kB     00:01    
Fedora 40 - x86_64                                                                                                                      1.4 MB/s |  56 MB     00:40    
Fedora 40 openh264 (From Cisco) - x86_64                                                                                                 97  B/s | 2.1 kB     00:22    
Fedora 40 - x86_64 - Updates                                                                                                            723 kB/s |  31 MB     00:44    
google-chrome                                                                                                                           3.4 kB/s | 3.7 kB     00:01    
RPM Fusion for Fedora 40 - Nonfree - NVIDIA Driver                                                                                      2.5 kB/s |  15 kB     00:05    
RPM Fusion for Fedora 40 - Nonfree - Steam                                                                                              597  B/s | 2.2 kB     00:03    
No match for argument: /usr/bin/smartctl
Error: Unable to find a match: /usr/bin/smartctl

Sorry, I missed that dnf can’t read its database. Alternatively, you can install smartmontools by downloading the rpm and using rpm command to install. However, you need to take care of dependent packages manually.

curl -O https://kojipkgs.fedoraproject.org/packages/smartmontools/7.4/3.fc40/x86_64/smartmontools-7.4-3.fc40.x86_64.rpm
sudo rpm -ivh smartmontools-7.4-3.fc40.x86_64.rpm

PS: Make a backup of data that is important to you as long as you can!

smartctl is /usr/sbin/smartctl

In this case you can do sudo dnf install smartctl.

No, I dont’t think so. smartctlis provided by package smartmontools.
I thought it would be installed by default. Installing with dnf as you suggested doesnt work for OP, his dnf is broken.

Doh! Obvious now you say it…

1 Like