You can use checkinstall to remove Python. The idea is:
- Install checkinstall
- Use
checkinstall to make a deb of your
Python installation
- Use
dpkg -r
to
remove the deb.
See this post for more details.
PS. Note that Ubuntu must always have at least one installation of Python installed, or else major pieces of your OS stop working. Above, I'm assuming it's safe to remove the Python built from source, without removing the Python that was installed by the package manager.
PPS. If you accidentally erase all Python installations from your Ubuntu machine, all is not lost. Instructions on how to recover from this situation can be found here.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…