General update errors

This isn’t specific to OSMC but was wondering if someone can help…
I played around with python to update it which all works but on the recent OSMC update I now get update errors…

osmc@Vero4K:~$ sudo apt-get update && sudo apt-get dist-upgrade
Ign:1 Index of /debian stretch InRelease
Hit:2 Index of /debian stretch-updates InRelease
Hit:3 Index of /debian stretch Release
Hit:5 Index of /debian/ stretch InRelease
Hit:6 http://security.debian.org stretch/updates InRelease
Hit:4 Index of /osmc/osmc/apt stretch InRelease
Hit:8 Index of /node_8.x/ stretch InRelease
Reading package lists… Done
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
The following packages will be upgraded:
python-apt
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
9 not fully installed or removed.
Need to get 0 B/164 kB of archives.
After this operation, 12.3 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database … 36526 files and directories currently installed.)
Preparing to unpack …/python-apt_1.4.1_armhf.deb …
File “/usr/bin/pyclean”, line 63
except (IOError, OSError), e:
^
SyntaxError: invalid syntax
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead …
File “/usr/bin/pyclean”, line 63
except (IOError, OSError), e:
^
SyntaxError: invalid syntax
dpkg: error processing archive /var/cache/apt/archives/python-apt_1.4.1_armhf.deb (–unpack):
subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
File “/usr/bin/pycompile”, line 35, in
from debpython.version import SUPPORTED, debsorted, vrepr,
File “/usr/share/python/debpython/version.py”, line 24, in
from ConfigParser import SafeConfigParser
ImportError: No module named ‘ConfigParser’
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/python-apt_1.4.1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
osmc@Vero4K:~$

Any ideas how to get to the bottom of it?

I would reinstall OSMC from the use of the Node repository and the changes you’ve made to the system environment.

"The Vero 4K features internal storage, but you can reinstall OSMC on the device in the same way that you can for any other OSMC compatible device. You will need an SD card or USB flash drive, which will allow you to load the OSMC installer on. When the Vero 4K is started with this card or drive, the internal storage will be formatted and repartitioned, and the version of OSMC you have downloaded will be installed.

Does that mean whatever I’ve set up on the Vero4k will be wiped aka home automation etc.

So I switched python version back and it works, anyway to fix this permanently other than a reinstall?

osmc@Vero4K:~$ sudo update-alternatives --config python
There are 2 choices for the alternative python (providing /usr/bin/python).

Selection Path Priority Status

  • 0 /usr/bin/python3.5 2 auto mode
    1 /usr/bin/python2.7 1 manual mode
    2 /usr/bin/python3.5 2 manual mode

Press to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/bin/python2.7 to provide /usr/bin/python (python) in manual mode
osmc@Vero4K:~$

osmc@Vero4K:~$ python --version
Python 2.7.13
osmc@Vero4K:~$ sudo apt-get update && sudo apt-get dist-upgrade
Ign:1 Index of /debian stretch InRelease
Hit:2 Index of /debian stretch-updates InRelease
Hit:3 Index of /debian stretch Release
Hit:5 http://security.debian.org stretch/updates InRelease
Hit:6 Index of /debian/ stretch InRelease
Hit:4 Index of /osmc/osmc/apt stretch InRelease
Hit:8 Index of /node_8.x/ stretch InRelease
Reading package lists… Done
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
The following packages will be upgraded:
python-apt
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
9 not fully installed or removed.
Need to get 0 B/164 kB of archives.
After this operation, 12.3 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database … 36526 files and directories currently installed.)
Preparing to unpack …/python-apt_1.4.1_armhf.deb …
Unpacking python-apt (1.4.1) over (1.4.0~beta3) …
Setting up python-apt-common (1.4.1) …
Setting up vero3-wifi-osmc (1.2.0-4) …
Setting up python3-apt (1.4.1) …
Setting up perftune-osmc (1.2.4) …
Processing triggers for mime-support (3.60) …
Setting up sudo (1.8.19p1-2.1+deb9u2) …
Setting up base-files-osmc (2.8.5) …
Fixing permissions on busybox.
Processing triggers for systemd (232-25+deb9u12) …
Setting up python-apt (1.4.1) …
Setting up mediacenter-addon-osmc (3.0.682) …
Setting up vero3-mediacenter-osmc (18.5.0-6) …
osmc@Vero4K:~$

If I run the update again it’s fine and says all good, flipped the python version back to 3.5.3

@Karnage – we could either adapt to support both versions; or specify python version upon invocation, i.e. /usr/bin/pythonX?