-1

This is an issue I just solved and I share my solution here in case someone runs into a similar one.

The latest Python version available on apt is 3.5 for Linux Mint 18.3. I updated to Python3.7 via the following method (adapted from this and this):

Add a private repository

>>> sudo add-apt-repository ppa:deadsnakes/ppa
>>> sudo apt-get update
>>> sudo apt-get install python3.7

Make Python3 point to Python3.7 (or whatever version you've updated to)

>>> sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
>>> sudo update-alternatives --config python3

Check the installation

>>> stat $(which python3)
>>> stat $(which python3.5)

Make pip point to the new Python version

>>> python3.7 -m pip install pip

In case someone follows this method: a large part of Mint relies on /usr/bin/python, which points to Python2.7, so don't change where this points to to avoid breaking the system, but python3 should be safe.

After that I noticed that mint wasn't working. When running it from the CLI, I got messages about missing packages: gi, pycurl, apturl, etc. These are not available from pip and need to be installed from apt. I tried to adapt this solution by copying and renaming the relevant packages into my local /home/[me]/.local/lib/python3.7/site-packages, but this is tedious.

It's not problematic in itself, as mintupdate is only a GUI for sudo apt-get upgrade.

harabat
  • 127
  • 2
  • 5

1 Answers1

0

Looking into the files raising error messages about missing packages (mintupdate.py, checkAPT.py, etc. in /usr/lib/linuxmint/mintUpdate/), I noticed that they had were calling python3 with #!/usr/bin/python3, so I changed this line into #!/usr/bin/python3.5 in each .py file in /usr/lib/linuxmint/mintUpdate/. I tested whether updates go through, whether kernels are displayed, etc., my solution solves this issue, but obviously the safest way is to not change where python3 points to.

harabat
  • 127
  • 2
  • 5