What will happen to old version of python when I upgrade from 16.04 to 18.04?
Updating to Bionic Beaver (18.04) won't change your Python installations as long as the upgrades go well and as planned. I would recommend to make a backup first, because sometimes they don't.
With 18.04 Python 2 is no longer comes preinstalled, and Python 3 has been updated to 3.6 - but as said: your manual installation stays as it is.
To uninstall, you can use e.g. (change for your need)
sudo apt-get remove python2.7
but there could be some dependencies preventing you to so so. Backward compatibility isn't so easy with Python. My personal recommondation would be to keep at least one 2.x version.
Some credit goes here: How can I remove python 2.7 after installing python 3.3?
If you just don't want to type python3
, you could also add an alias to your bash's configuration file, so when you'll write python in your terminal, it will be like writing python3. This is useful, but potentially can create misunderstanding.
HOW TO DO
Add
alias python=python3
at the bottom of the ~/.bashrc
file (or simply enter this in your console with sufficient rights echo "alias python=python3" >> ~/.bashrc
)
Than do:
source ~/.bashrc
from the terminal to update bash with the changes (Source).