Mon. Apr 6th, 2020

Developers continue to remove Python 2 from Ubuntu 20.04 LTS

2 min read

The mailing list for the Ubuntu development team has been updated with the latest progress in removing Python 2 from Ubuntu 20.04 LTS, and its developers are working to ensure that Python 2 will not be available as part of the next Ubuntu LTS release. According to the latest progress report, although the process of removing Python 2 is long, it is currently going smoothly.

Python 2.7 retire

Based on some discussions, we are going forward with the Python2 removal.
python-defaults now migrated to the release pocket and therefore removing
the binary packages

libpython-dbg libpython-dev libpython-stdlib
python python-dbg python-dev python-doc python-minimal

All dependencies to these packages have been removed in the release and proposed pockets, and hopefully won’t come back again. Further steps are:

– Remove outstanding references to these binary packages in the list of not built from source list. This means any package having a build dependency on one of the above packages will need a fix.

– Scan the binary packages in the release pocket for the use of the python shebang, and fix those to use python2 instead of python. This will not include shebangs used in examples shipped in /usr/share/doc (we didn’t care about these before, and we don’t care about those now).

– After the next archive test rebuild, check for build failures caused by the removal of the python shebang.

– Before release, add a binary package “python-is-python2-but-deprecated” package shipping the /usr/bin/python symlink, and providing the python package. This allows users to keep the python symlink on upgrade from earlier releases, or to explicitly install it if needed for legacy requirements. It also allows packages from PPAs or third-party sources to be installable.
*The “python-is-python2-but-deprecated” package must not be used in build dependencies, dependencies and recommendations in the focal release.*

– Forward looking, we are adding a package python-is-python3, also providing the python symlink, which is *not* installed by default in 20.04 LTS. In follow-up releases and in 22.04 LTS the python symlink pointing to python3 will be installed by default. *python-is-python3 must not be used in dependencies, build dependencies and recommendations.*

– Document that setup in the release notes.

– 20.04 LTS will ship python2. Derivatives who cannot port some applications are able to use python2 for the 20.04 LTS release.

In addition, Ubuntu 20.04 LTS still retains Python2 in the package archives, mainly because users still need it and Ubuntu derivatives that have not yet ported any code to Python 3.