Problem installing updates/new packages

I’m running OSMC on several machines, and on two of them I have issues installing and updating packages.

I’ll happily provide more info when needed.

Here’s output from one machine that I’ll like to try and fix first.

osmc@Sovrum:~/RPi.GPIO-0.5.11$ sudo apt-get install python-dev

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following additional packages will be installed:

libexpat1 libexpat1-dev libpython-dev libpython2.7-dev python2.7-dev

The following NEW packages will be installed:

libexpat1-dev libpython-dev libpython2.7-dev python-dev python2.7-dev

The following packages will be upgraded:

libexpat1

1 upgraded, 5 newly installed, 0 to remove and 14 not upgraded.

Need to get 0 B/28.2 MB of archives.

After this operation, 36.3 MB of additional disk space will be used.

Do you want to continue? [Y/n] y

/usr/bin/dpkg: error while loading shared libraries: hd-linux-armhf,so.?: cannot open shared object 
file: No such file or directory

E: Sub-process /usr/bin/dpkg returned an error code (127)

osmc@Sovrum:~/RPi.GPIO-0.5.11$

I tried:

osmc@Sovrum:~/RPi.GPIO-0.5.11$ sudo dpkg --configure -a

dpkg: error while loading shared libraries: hd-linux-armhf,so.?: cannot open shared object file: No such file or directory

osmc@Sovrum:~/RPi.GPIO-0.5.11$

I suspect that the SD card might be corrupted here. First recommendation is to backup everything you can right now.

Hmm, could be, had a few power-outages during thunder storms here a few weeks back.

Nothing really that hard to reconfigure, so a backup doesn’t feel that necessary. Do you think I should reinstall or try something else first?

It is hard to speculate what else may be corrupted.
I would try running: sudo touch /forcefsck and reboot. This will force OSMC to check filesystem integrity on boot. But it may not resolve your issue

Do they both exhibit the same error?

Tried this and rebooted, ended up in a crash at boot loop

I’ll replace the SD-card and reinstall

@dillthedog

hmm… just tried the same commands on the other machine and it worked, I might have mistaken it for the bad one, similar ip 121, and 120