Ubuntu – How to remove python 2.7 after installing python 3.3

pythonpython-2.7

I have successfully installed python 3.3 on Ubuntu 12.10. Since I don’t need multiple versions of python, I want to remove the existing python 2.7. When I try to do that, using

sudo apt-get remove python2.7

Ubuntu warns me that there are tons of system dependent components which will also be removed. It looks really scary.

So, is there a way to remove python 2.7 without removing the system dependent components, or can I direct those dependents to use python 3.3?

Best Answer

You can't.

From the Ubuntu wiki / Python:

Longer term plans (e.g. 14.04)

Move Python 2 to universe, port all Python applications in main to Python 3. We will never fully get rid of Python 2.7, but since there will also never be a Python 2.8, and Python 2.7 will be nearly 4 years old by the time of the 14.04 LTS release, it is time to relegate Python 2 to universe.

This means that a lot of base packages have hard dependencies on 2.7 and it will still take a lot of time tot get things migrated. Note that Python 3 has numerous backwards incompatible changes -- it's not a regular package upgrade.

If you really want to get rid of Python 2.7, you'll have to wait for the 14.04 release, but there's no guarantee.

Related Question