Score:0

Errors on apt update with input and output error

pt flag

when i try to update on my ubuntu 20.04 some errors appear, i show what it is

Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://packages.microsoft.com/repos/code stable InRelease                
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease                         
Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease                 
Hit:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:6 https://deb.nodesource.com/node_14.x focal InRelease
Hit:7 http://archive.ubuntu.com/ubuntu focal-security InRelease
E: Read error - read (5: Input/output error)
Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 27, in <module>
    col.create(db)
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 95, in create
    self._fill_commands(con)
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 141, in _fill_commands
    raise subprocess.CalledProcessError(returncode=sub.returncode, 
subprocess.CalledProcessError: Command '/usr/lib/apt/apt-helper cat-file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_focal_universe_cnf_Commands-amd64' returned non-zero exit status 100.
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code

why my python3 raise subprocess.CalledProcessError? How can i fix this

Vu Nguyen avatar
pt flag
No i dont know, can you explain that?
user535733 avatar
cn flag
An `input/output error` means a fault with your storage device. Maybe it has a bad block that can be bypassed. Maybe it is dying. Look up how to run a SMART test on the device...and how to read the results. If your device is not dying, then look up how to use `badblocks` to isolate the faulty blocks.
Vu Nguyen avatar
pt flag
thank you so much, your answer is great, my disk has block errors, i often run fsck manually on /dev/sda6. In your opinon, how can i avoid these badblocks
ru flag
if you have bad blocks you need to start looking into replacing your disk. I/O errors of this nature indicate failing disks and theres no way to 'avoid' blocks manually (except maybe running a tool like badblocks). However, if you are often running fsck you really need to look into replacing the disks because the bad blocks will continue to accumulate until your system is unusable.
Vu Nguyen avatar
pt flag
thank you for your answer
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.