12

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.

7
  • 3
    You should really just stop using Python 2, it's EOL.
    – AKX
    Apr 28, 2020 at 17:52
  • 1
    I think I have to, since I want to build node.js Apr 28, 2020 at 18:04
  • 1
    Why? You can get the Linux binary tarball for any version of Node from nodejs.org.
    – AKX
    Apr 28, 2020 at 18:06
  • @AKX Cool, I'll check it out Apr 28, 2020 at 18:15
  • 1
    Besides, I'd imagine Ubuntu 20.04 has a recent version of Node in its default repos?
    – AKX
    Apr 28, 2020 at 18:20

1 Answer 1

13

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.

5
  • As of ubuntu 22.04, the python-is-python2 package still exists and can fix the problem easily.
    – Cris
    Nov 30, 2022 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, 2022 at 8: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. Jan 7 at 3:07
  • @EduardoReis you should open a new question, maybe on Ask Ubuntu. Jan 8 at 22:38
  • 3
    As of April 2023, python-is-python2 is no longer there on 22.04 Apr 19 at 16:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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