18

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?

user1592380
  • 1,833
  • 5
  • 26
  • 31
  • 1
    Reinstall the Ubuntu version. Do not, at any time, leave your system without a working python installation – Nonny Moose May 03 '17 at 13:00
  • 2
    these are multiple other pythons on the system, including python 3.5 and 2.7. I just want to avoid conflicts with python3.6. in fact if I do python -V , I get 3.5. – user1592380 May 03 '17 at 13:05
  • 1
    First of create a snapshot or backup of your system. apt-get purge python3.6 will remove python3.6 and the all related packages, then try conda. If anything went wrong you can still restore the system to the original state. – ampika May 03 '17 at 13:09
  • See [How can PPAs be removed?](https://askubuntu.com/questions/307/how-can-ppas-be-removed) – steeldriver May 03 '17 at 13:10
  • 1
    Sorry for my ignorance, but what would you recommend for a system "snapshot"? – user1592380 May 03 '17 at 14:30
  • Here are many solution. Pick the best for you: https://askubuntu.com/questions/19901/how-to-make-a-disk-image-and-restore-from-it-later – ampika May 03 '17 at 16:30
  • @user61629 Oh, you're right. I was thinking of python3.5. My bad, but I'm glad you're being cautious. – Nonny Moose May 03 '17 at 22:48

3 Answers3

16

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
    
wjandrea
  • 14,109
  • 4
  • 48
  • 98
  • 6
    This should be deleted. It just break the whole system. Or at least this should be advised in bold letters. – pceccon Sep 04 '19 at 00:53
  • @pceccon I've added another warning. Make sure you read the question in the future! This won't be deleted cause it's still potentially useful. – wjandrea Sep 04 '19 at 01:05
  • The question describes the same that happend to me. Manually installed python3 and decided to go for anaconda. Thanks for the bolded info. – pceccon Sep 04 '19 at 01:09
  • @pceccon I've clarified the warning. What version of Ubuntu are you using? – wjandrea Sep 04 '19 at 01:13
  • I purged it but only after I applied `sudo apt autoremove` it got removed from the machine. I'm new to ubuntu so may I know why? And I could understand the overall picture but not the technical reason why the purge is not enough? – Parvathirajan Natarajan Jun 06 '20 at 13:27
2

I followed the instructions above (1:Remove the repo 2:Refresh apt cache 3:Remove the package and found that a lot of my Linux tools and APPS "Disappeared". Not being an expert in identifying and reinstalling each on demand I opted for a full re-install and update. The advise is to make periodic image and backups more like restore points so that you don't have to start from scratch. Make note of your customizations if you are not already documenting the changes to your machine.

Gareth
  • 29
  • 1
  • 1
    Your stuff disappeared cause you're using Ubuntu 18.04 or 18.10, which rely on Python **3.6**. The question is about Ubuntu 16.04, which relies on Python **3.5**. I've added a warning to my answer. Make sure you read the question in the future! – wjandrea Sep 04 '19 at 01:08
0

I had the same problem, then I make autogeneration of setup.Py file where i could add an interpreter in the optionbox

I dunno if it can help someone