0

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

  • No i dont know, can you explain that? – Vu Nguyen Jan 05 '23 at 14:53
  • 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. – user535733 Jan 05 '23 at 15:07
  • 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 – Vu Nguyen Jan 05 '23 at 15:13
  • 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. – Thomas Ward Jan 05 '23 at 15:58
  • thank you for your answer – Vu Nguyen Jan 05 '23 at 16:02

0 Answers0