6

I have an old problem (since a week) with apt-get which prevents me from installing and upgrading packages. I have Ubuntu 16.04.

I am receiving this message on the top bar:

Error: opening the cache (E: Read error - read (5: Input/output error))

When I type on the terminal: sudo apt-get update, nothing goes wrong and it was completed successfully.

However, when I type sudo apt-get upgrade or sudo apt get install , I get this output:

Reading package lists...    
Done Building dependency tree           
Reading state information... Error! E: Read error - read (5: Input/output error)

I have tried to delete the /var/lib/dpkg/status file and then update, but nothing change!

8
  • You have a serious problem with your disk.
    – Pilot6
    Jul 24, 2016 at 16:16
  • which means what :) do you suggest any solution ?
    – mohammed
    Jul 24, 2016 at 16:20
  • Probably you need to replace it.
    – Pilot6
    Jul 24, 2016 at 16:20
  • replace the package manager ? or the whole operating system
    – mohammed
    Jul 24, 2016 at 16:21
  • You can check the disk by running sudo touch /forcefsck and reboot.
    – Pilot6
    Jul 24, 2016 at 16:21

2 Answers 2

10

Try this please as a last possible solution. Open a terminal and type these commands:

sudo rm /var/lib/apt/lists/* -vf
sudo apt-get clean
sudo apt-get update

If this doesn't work either, then the hard disk problem is the most probable cause for this message unfortunately.

6
  • These commands are harmless, so no need to call them "last possible solution". But the error message does not suggest anything which could be fixed this way.
    – Byte Commander
    Jul 24, 2016 at 17:13
  • Yes, you're right. It just eliminates the possibility of file corruption. Nothing else.
    – Stormlord
    Jul 24, 2016 at 17:22
  • Corrupt file content would produce a different error. If this method magically solved the issue, it would probably be because the file which causes read errors got recreated in a different, not defect sector on the disk. That way you do not fix the root cause though but only hide it and wait for it to bite you more severely.
    – Byte Commander
    Jul 24, 2016 at 17:27
  • The main reason why I proposed these commands was the fact that the guy does not state anywhere that he gets similar error messages from other apps too or that their system gives errors while starting etc. They gave me the impression that only apt-get produces error messages.
    – Stormlord
    Jul 24, 2016 at 18:05
  • Worked for me! No issues afterwards.
    – GTodorov
    Oct 30, 2017 at 21:47
7

This read/input-output error indicates serious disk failure!

Back up all important data immediately and look for a new hard disk.


You can find out more details about your disk health by checking its S.M.A.R.T. status.

Open gnome-disks, select your HDD in the device list on the left and click the hamburger menu in the top right corner. Chose SMART Data & Self-Tests to view the information.

5
  • Actually it is a new laptop (just 4 weeks of using) which I have bought and then I replaced Its windows OS with ubuntu 16 :(
    – mohammed
    Jul 24, 2016 at 16:30
  • As mentioned, check its SMART status and maybe run some of the offered self-tests. That will assure you whether it is a disk failure (very likely) or not.
    – Byte Commander
    Jul 24, 2016 at 18:07
  • I have opened the Disk app, and the assessment tells that: Disk is OK, 125 bad sectors.
    – mohammed
    Jul 24, 2016 at 18:11
  • Then you should run the self-tests. They're in the lower right corner of the SMART results window.
    – Byte Commander
    Jul 24, 2016 at 18:20
  • +1 from me; I got this after copying all data from a known-failing disk to a new one. Together with the other answer and a bit of DIY file fixing I got it to a state where it now seems to work fine again.
    – dascandy
    Aug 25, 2019 at 22:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .