9

I'm curious if Ubuntu "pins" minor Python versions for each of its releases. Looking at the package details for python3 in Focal, compared to other LTS releases, e.g. Bionic seems to be sticking to Python 3.6. Is this documented anywhere to be true? Or is it just the status quo at the moment? Or am I misunderstanding Ubuntu packages?

I did find a related question, but not quite in the same vein so it didn't answer my question: Pin Python minor version in Ubuntu 18.04.4 LTS

1 Answer 1

19

Your understanding is accurate.

A release of Ubuntu sticks with the same 3.x release of Python for the entire life of that Ubuntu release. Ubuntu 18.04 (Bionic) will indeed stick to Python 3.6 until Bionic reaches EOL in 2028.

  • Ubuntu 20.04 = Python 3.8
  • Ubuntu 22.04 = Python 3.10

Sticking to a single version for the life of the release of Ubuntu is the way that Debian-based distros have worked for over 20 years: With a couple exceptions, all software uses a single common set of dependencies. Only security patches and bugfixes that don't break the common set are pushed after release. New versions tend to break that common set of dependencies, so new versions await the next release. That's one of the reasons that Ubuntu releases anew every six months.

Many distros, including Ubuntu, use a lot of Python under the hood. Changing the Python version can break things. Example: This site is soaked in the tears of folks who broke apt by changing their version of Python.

7
  • 4
    Very good: "soaked in the tears"! No one should play around with python versions in Ubuntu (and most other distros)
    – kanehekili
    Aug 18 at 0:06
  • Very insightful +1. Can I somehow see which version of python, or any package, is pinned in my system?
    – Jos
    Aug 18 at 12:09
  • 1
    Well, a 'pin' actually has a definition different from your use, which is why I did not use that term. Apt will happily tell you what versions of any particular package you have installed on your release of Ubuntu. See man apt-cache for lots of information about version information.
    – user535733
    Aug 18 at 16:58
  • 1
    @user535733 You don't need apt-cache, you can simply use apt, i.e. apt show python3 and check the "Version" line.
    – wjandrea
    Aug 18 at 17:39
  • @user535733 Cool, looks like it's implicitly documented here: wiki.ubuntu.com/StableReleaseUpdates
    – wjandrea
    Aug 18 at 18:21

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.