Uninstalled osmc-network package

Ok, I did something really stupid. I tried to uninstall some packages that I’ve previously installed to test. I ran the following to uninstall “Bluez” which I couldn’t get working, and don’t really need my bluetooth keyboard anyway.

So, I ran:

sudo apt-get remove bluez

Then, confirmed using the phrase it asked for “Yes, please do what I say!”, or something similar.

Then, after I had confirmed that, I realised it said it was uninstalling “bluez” and “osmc-network” (or “network-osmc”, I can’t remember exactly because Putty timed out).

So, I now realise I’ve uninstalled a vital service for the network connectivity - meaning I cannot connect through SSH anymore.

What can I do to fix this? Is there a way I can reinstall this by zip file?

There are a few ways around this - one is to manually bring up ethernet using ifconfig and manually set resolvers in /etc/resolv.conf so you can connect to the update server.

The other is that you may already have an older version of network-osmc in the apt cache, if so you can install directly from there with dpkg.

For example on my Pi 2:

osmc@rpi2:~$ ls -al /var/cache/apt/archives/armv7-network-osmc*
-rw-r--r-- 1 root root 2608 Mar 18 17:54 /var/cache/apt/archives/armv7-network-osmc_1.3.7_armhf.deb
-rw-r--r-- 1 root root 2632 Mar 25 09:25 /var/cache/apt/archives/armv7-network-osmc_1.3.8_armhf.deb
-rw-r--r-- 1 root root 2644 Mar 27 16:48 /var/cache/apt/archives/armv7-network-osmc_1.3.9_armhf.deb
-rw-r--r-- 1 root root 2642 Apr  3 23:01 /var/cache/apt/archives/armv7-network-osmc_1.4.0_armhf.deb

For Pi 1 it would be armv6-network-osmc.

Assuming you have at least one version of the package on your local system try to install the most recent version like this:

sudo dpkg -i /var/cache/apt/archives/armv7-network-osmc_1.4.0_armhf.deb

If you don’t have a copy you could download a copy from here and place it on your SD card:

http://46.37.189.135/osmc/apt/pool/main/a/armv7-network-osmc/

Then install with dpkg -i.

BTW remember you can log in at a local console with a keyboard by exiting from Kodi and pressing ESC at the splash screen.

Thanks for your help, I will give that a go!

Hi, I there was nothing in the cache that resembled that.

I downloaded the package from the link you posted, and copied it to my USB stick, which is mounted to /media/usb. I have ran the following:

sudo dpkg -i /media/usb/pkg/armv7-network-osmc_1.4.1_armhf.deb

But, that returns an error:

dpkg-deb: error: ‘/media/usb/pkg/armv7-network-osmc_1.4.1_armhf.deb’ is not a debian format archive

Any ideas?

Ok, so I downloaded the 1.4.0 instead and that seems to get further, but I get this error instead now:

dpkg: dependency problems prevent configuration of armv7-network-osmc:
armv7-network-osmc depends on armv7-connman-osmc; however:
Package armv7-connman-osmc is not installed.
armv7-network-osmc depends on bluez; however:
Package bluez is not installed.
armv7-network-osmc depends on iptables; however:
Package iptables is not installed.

Hi, I’ve got a bit further with this. I ran:

apt-get update
apt-get upgrade.

It then advised me to run:

apt-get upgrade -f

Which installed all the missing bits, although did give an error about installing network-osmc due to not being able to restart connman.service. I’ve tried installing network-osmc 1.4.0 again using dpkg, and turning on various levels of debug, but it always seems to fail, stating “Failed to restart connman.service: Unit connman.service is masked.” I get the same message when trying to do apt-get upgrade.

osmc@osmc:~$ sudo dpkg -i --debug=2000 /pkg/armv7-network-osmc_1.4.0_armhf.deb
(Reading database … 20847 files and directories currently installed.)
Preparing to unpack …/armv7-network-osmc_1.4.0_armhf.deb …
Unpacking armv7-network-osmc (1.4.0) over (1.4.0) …
D002000: infodb foreach file this pkg
D002000: infodb foreach file this pkg
D002000: infodb foreach file this pkg
D002000: infodb foreach file this pkg
D002000: infodb foreach file this pkg
D002000: infodb foreach file this pkg
D002000: infodb foreach file this pkg
Setting up armv7-network-osmc (1.4.0) …
Failed to restart connman.service: Unit connman.service is masked.
dpkg: error processing package armv7-network-osmc (–install):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
armv7-network-osmc