0

Whenever I try to update Linux Mint 18.1, I get the following error from the Update Manager.

E: /var/cache/apt/archives/mintupdate_5.2.1.3_all.deb: subprocess new pre-removal script returned error exit status 1

If I try to update from command line, I get the following:

    Preparing to unpack .../mintupdate_5.2.1.3_all.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/mintupdate_5.2.1.3_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ModuleNotFoundError: 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/mintupdate_5.2.1.3_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm kind of lost.

EDIT: Ok... I found some further info and it seems I messed up royally. That's what I get when I ask for versions on the terminal:

$ python --version
Python 3.6.3
$ python3 --version
Python 3.5.2
$ python2 --version
Python 2.7.12

It's been long since I messed with this, and I no longer remember how I did this. I'm looking for how to revert it.

0

So, after quite some investigation, I've found a fix. IN the /usr/bin dir, I found the link python pointing to /etc/alternatives, which led me to the command update-alternatives.

By typing on terminal update-alternatives --display python, I get that python points to python3.6 executable.

Use sudo update-alternatives --set python and enter the number presented as the desired option (python2.7, in this case).

Fixed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.