Python Forum

Full Version: I can't remove python. I'm not kidding, it doesn't get uninstalled.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've spent like a week's worth of man-hours trying to get uwgsi to work (see https://python-forum.io/Thread-ImportErr...#pid104516 ), and my problem must be obscure because no one's advice works (or I get no responses to posts on forums), I got desperate so tried removing python and reinstalling it. It won't uninstall.

Ubuntu 18.04.2

sudo apt-get remove python.

It does a lot of stuff, clears up 250something MB.

I type python. I get a python prompt.
I type python2. I get a prompt.
I type python3. I get a prompt.

So I sudo apt-get remove python3.

Once again, it removes a bunch of packages, etc, clears up (now it's 500something MB)

I type python3.
I get a prompt.

It won't die.

It's not like I have it in some obscure place.

bog@bog-Lenovo-Product:~/tdailydiscount$ which python
/usr/bin/python
bog@bog-Lenovo-Product:~/tdailydiscount$ which python3
/usr/bin/python3
bog@bog-Lenovo-Product:~/tdailydiscount$ which python2
/usr/bin/python2
How do I kill python so I can reinstall it?
I'm afraid you broke your Ubuntu system. One must not remove python in a Ubuntu system. The gigabytes that were removed are other programs that depend on python. As a general rule, it is not a good idea to carry on with sudo apt-get remove when the system warns of a large bunch of removals. It means that you're doing something wrong. In your position, I would reinstall Ubuntu.
OK when I reboot I get the CLI. It doesn't have network capability, but if I can get network capability to work then presumably I can just reinstall python (which ironically was still working so... uhhh... was still installed.)

So if I can reinstall python and all of its packages then presumably it might be ok?

oh you mean entire programs? Not just packages they depend on?
david503 Wrote:oh you mean entire programs? Not just packages they depend on?
I mean that apt removed programs that depend on python to run. They won't be reinstalled if you attempt something like "reinstalling python", which by the way is probably unnecessary because in the end you still have python.

It is not difficult to reinstall ubuntu
  1. Save your personal files on an external hard drive before you do anything else.
  2. Burn a bootable DVD with the .iso image of Ubuntu 18.04 downloaded from the ubuntu website. They say that you can also create a bootable USB key instead of a DVD but usually I don't have much success with this.
  3. Reboot the computer on the DVD (make sure the computer is connected to the internet) and follow the installation instructions.
  4. Remove the DVD, reboot the computer and do sudo apt update and then sudo apt upgrade in a terminal.
  5. Reboot and enjoy a fresh install of Ubuntu.
Yea yea I know how to reinstall ubuntu, thanks. (I'm a developer for 20+ years, so...). It's going to take about three days to reinstall everything again. I wish this had all happened two months from now because Ubuntu 20 LTS comes out in april. Ug. I can't hobble along on a livecd all the way till then so I gotta bite the bullet. Here I go.

thanks
I realised that apt has a history log. By looking in the history log, one should be able to reinstall packages that were uninstalled.