9

I installed Python 3.9 on my Ubuntu 16.04 LTS system, in addition to the default 2.7 and 3.5 that come with the system. I can call it perfectly by typing python3.9, and also use pip3.9 commands.

I want to remove it form the system, for reinstalling it, or even and earlier version of python instead.

I tried already sudo apt-get remove python3.9 , sudo apt-get autoremove python3.9, sudo apt-get purge python3.9, sudo apt-get remove --purge python3.9 and sudo apt-get autoremove --purge python3.9. None seems to make effect.

When I call python3.9 it comes:

Python 3.9.0 (default, Nov 14 2020, 00:35:31)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

How could I fix that? Thx

3 Answers3

14

in case you still need it.

first of all, it's never advisable to uninstall python. check for instance this link.
having said this, Ubuntu 16.04 does not depend (wasn't build) on Python 3.9 (check this out, for instance). thus, and in principle you shouldn't be having problems fully uninstalling it... as it was my case.

i had no troubles following these steps; which for you/me would be something like:

sudo apt-get clean
sudo apt-get autoremove --purge
sudo apt-get remove python3.9
sudo apt-get autoremove
good luck!
Manuel F
  • 168
  • 4
    Need more than "not working" to help you. Error messages, things you expect that aren't happening, or vice versa, etc. – Matt Welke Jan 08 '21 at 02:36
  • Hey your answer has helped me as well. but do you think its advisable to maybe consider upgrading my ubuntu 16 to say ubuntu 20? I have been using ubuntu 16 from around 2017 and after trying other versions like 17 and 18, i just decided to resort to my 16 because it was just stabler for me. but these days i get a lot of version conflicts with a lot of the software i always want to install. some advice. – NMukama Jan 22 '21 at 14:48
  • 1
    hi @N.M.Jedidiah. this is more of a cautionary tale. rule #1: IF IT AIN'T BROKEN, DON'T TRY FIX IT :D. I upgraded to Ubuntu 20LTS, and it's awesome. i was on Ubuntu 18. long story short: i ended up installing U20 from scratch cause my machine broke during the upgrading. So, 1st of all back up your files!!. then, do something like this. If you ended up having this issue you'll be as miserable as i was; but if you never try... – Manuel F Jan 23 '21 at 01:31
2
  1. Install synaptic using

    sudo apt install synaptic
    
  2. Open synaptic

    enter image here

  3. Search for "python 3.9"

    enter image here

  4. Right click on "python 3.9" and Select "mark for complete removal"

    enter image here

  5. Click apply

Kulfy
  • 17,696
0

In ubuntu 20.04.2 I had a similar issue and following these steps the python dependency was fixed

sudo apt-get clean
sudo apt-get autoremove --purge
sudo apt-get remove python3.9
sudo apt-get autoremove
sudo apt --fix-broken install