11

I have upgraded to Ubuntu 20.04 LTS from Ubuntu 20.04 (dev branch) and I have noticed that sudo apt install python installs python-is-python-2 instead of python2 (from Ubuntu 18.04) or python-minimal (from Ubuntu 20.04 dev).

Is this something new? Is this package different in any way with respect to the other two? As of now, the installation is complete and I notice that python2 opens up Python 2.7 in the terminal.

Aaron John Sabu
  • 297
  • 1
  • 2
  • 13

1 Answers1

12

This no longer happens in ubuntu 20.04. The python-is-python2 package no longer exists (but there is python-is-python3 which does the same thing but makes the python command call python3).

If you still need python2 to be the default for the python command you can do something like:

sudo ln -s /bin/python2.7 /usr/bin/python

This can be important if you are using something like repo which doesn't support python3 (and maybe never will). See here.

Benjamin Loison
  • 3,782
  • 4
  • 16
  • 33
Fantastic Mr Fox
  • 32,495
  • 27
  • 95
  • 175
  • As of ubuntu 22.04, the python-is-python2 package still exists and can fix the problem easily. – Cris Nov 30 '22 at 18:21
  • 1
    @Cris you probably would not want it anymore as it breaks/conflicts with `dh-python`, a critibal tool for dpkg to pack up and build python3 related packages. Google `dh-python breaks python` would give you some ideas. I don't see why `dh-python` is not fixed; probaby the author does not want to. – stucash Dec 20 '22 at 08:52
  • I am trying really bad to install medeley desktop via dpkg and it still asks for `python`. I tried the symbolic link and nothing. Not sure what to try next. – Eduardo Reis Jan 07 '23 at 03:07
  • @EduardoReis you should open a new question, maybe on `Ask Ubuntu`. – Fantastic Mr Fox Jan 08 '23 at 22:38
  • 2
    As of April 2023, python-is-python2 is no longer there on 22.04 – Thermal_insulator Apr 19 '23 at 16:37