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.

marked as duplicate by wjandrea, N0rbert, user535733, George Udosen, vidarlo May 9 at 18:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

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.

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