Ubuntu – Uninstall python 3.6

16.04python

Following this guide Testing Deployment Using a Staging Site, I have installed python 3.6 on Ubuntu 16.04 using:

sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get install python3.6

Unfortunately I now want to use the anaconda package manager, and so to avoid a conflict I'd like to remove all traces of my upgrade. How?

Best Answer

Warning: This will break Ubuntu 18.04 and 18.10. These instructions apply to the specific situation described in the question, on Ubuntu 16.04.


Warning: I have tested this solution, but not very thoroughly. Make a backup, and proceed with caution.

  1. Remove the repo:

    sudo add-apt-repository --remove ppa:fkrull/deadsnakes
    
  2. Refresh apt cache:

    sudo apt-get update
    
  3. Remove the package:

    sudo apt-get remove --purge python3.6
    
Related Question