0

I'm on Ubuntu 19.04 and I would like to make sure that if I try to install some software with a hard Python 2 dependency that it would just fail instead of installing 2 on my system.

2

Use apt-mark:

See the apt-mark manpage:

PREVENT CHANGES FOR A PACKAGE

hold

hold is used to mark a package as held back, which will prevent the package from being automatically installed, upgraded or removed.

Try:

sudo apt-mark hold python

Note that this is a Really Bad Idea on Ubuntu 16.04 and earlier, as Python 2 is an essential part of those releases.

| improve this answer | |

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