Setting Error on Startup

I have seen threads about this in the forum but on following the advice still get no further to fixing it.

On startup I see messages like Script Error: OSMC Settings.

I cannot try an update as it fails with a similar error. I have also tried a manual update by doing the below:

sudo apt-get update; sudo systemctl start manual-update

but that fails with

Archives directory /var/cache/apt/archives/partial is missing.

But on trying to create that folder it just fails

mkdir: cannot create directory ‘/var/cache/apt/archives’: Input/output error

If I query the folder using ls -l I get ???

osmc@osmc:/var/cache/apt$ sudo ls -l
ls: cannot access archives: Input/output error
ls: cannot access srcpkgcache.bin: Input/output error
total 42912
d??? ? ? ? ? ? archives
-rw-r–r-- 1 root root 22005979 Sep 27 17:00 pkgcache.bin
-??? ? ? ? ? ? srcpkgcache.bin
-rw-r–r-- 1 root root 22005979 Sep 27 17:00 srcpkgcache.bin.vecots

I have included a copy of my log file on pastebin OSMC Setting Error - Pastebin.com

Looking at it this comes up when the setting file is accessed.
Line 646

Error Type: <class 'socket.error'>

Sounds like it cannot connect to something? But I can ping google from the pi and can connect to it over my network fine.

Any ideas?

It looks like you are suffering from filesystem corruption

Sam

Ok so a brand new install is needed? I just need to copy the sources.xml file and copy that back after?

May be fixable with fsck. For reference, what SD card do you have and what power supply are you using?

Sam

I’ve gone for a wipe, with your new install tool its so easy now.

For reference its just a SanDisk Extreme 9GB 45mb/s card and powerd via the TV usb (I did this as it had issues with the CEC remote would fail to work after the pi being left on for a while)

DO you think the TV power is causing the corruption maybe?

Yes

The TV won’t be able to supply enough power to your device and this will cause crashes and instability.

Sam

Ok. Will need to change that then to ensure it doesn’t happen again. Will see if the original CEC issue continues.