1

i'm working on Ubuntu 16.04 and after having some troubles with pip and python, i've decided to try to unistall both python and python3, with the command:

sudo apt-get purge python 

and

sudo apt-get purge python3

Now the thing is that if i type python or python3, i get nothing but the python shell opens, like everything is still there. So i don't understand what i've done/unistalled with my commands. Plus i've tried to reinstall what i've deleted by typing:

sudo apt-get install python

but instead of getting some download, it gives me a message of the type:

`Some packages could not be installed. This may mean that you have
 requested an impossible situation or if you are using the unstable
 distribution that some required packages have not yet been created
 or been moved out of Incoming.
 The following information may help to resolve the situation:

 The following packages have unmet dependencies:
 python : Pre-Depends: python-minimal (= 2.7.11-1~) but version 2.7.12-1~16.04 it is going to be installed
          Depends: libpython-stdlib(=2.7.11-1) but version 2.7.12-1~16.04 it is going to be installed
 E: Unable to correct problems, you have held broken packages.`

I'm practically new to all this world, so i don't really have a guess on what is happening here, also because i've read that default python shall not be unistalled, otherwise system get broken. Thanks for any help!!

1
  • The error message seems to indicate that you have disabled (or not enabled) the xenial-updates repository.
    – user535733
    Nov 12, 2018 at 12:32

1 Answer 1

1

You're not supposed to delete Python or Python3 as this will leave your OS with unmet dependencies it needs for basic functionality. You can try to repair the problem with dpkg --configure -a or sudo apt-get --fix-missing install however chances are you have now broken your OS and will need to reinstall.

3
  • 1
    I think your answer is too kind. Removing Python2/3 WILL BREAK THE SYSTEM QUITE HORRIBLY. Vital elements of the OS use Python.
    – user535733
    Nov 12, 2018 at 12:30
  • howling. true but I'm no master. we all start somewhere
    – user797940
    Nov 12, 2018 at 20:03
  • 1
    Sorry if i reply just today, but it took time to try to fix the problem and i ended up reinstalling Ubuntu. I just want to point out that what i've done surely was bad, but it's not something i've decided out of blue, but that i've read in other forums with no mentions to the danger of doing that. Moreover i don't think it's really smart to allow to delete python so easily if it causes all those troubles. However thanks @tREEs for you answer
    – nabbo
    Nov 13, 2018 at 14:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .