6

How to uninstall python3 from Ubuntu

 2 years ago
source link: https://gist.github.com/zhensongren/811dcf2471f663ed3148a272f1faa957
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
How to uninstall python3 from Ubuntu

To list all python versions in default locations

ls /usr/bin/python*

To remove just python3 package

sudo apt-get remove python3.5

plus it's dependent packages

sudo apt-get remove --auto-remove python3.5

plus configuration and/or data files of python3

sudo apt-get purge python3.5

both configuration and/or data files of python3.5 and it's dependencies

sudo apt-get purge --auto-remove python3.5

How to install new version of python

sudo apt-get update

sudo apt-get install python3

Also, see https://docs.python-guide.org/starting/install3/linux/ or install python3.8 https://linuxize.com/post/how-to-install-python-3-8-on-ubuntu-18-04/

ModuleNotFoundError: No module named '_sqlite3'.

  • sudo apt-get install libsqlite3-dev
  • ./configure --enable-loadable-sqlite-extensions && make && sudo make install

Thanks!
Happy New Year

WARNING: BE EXTREMELY CAREFUL!!!
mysql and many other important things may be dependencies that will get removed if you run this.

last time my all packages related to ubuntu were also deleted using this,,so be careful before confirming to yes

Very careful before using above command.
In case you successfully uninstalled default package, use below command ;)
sudo apt-get install ubuntu-desktop

Very careful before using above command.
In case you successfully uninstalled default package, use below command ;)
sudo apt-get install ubuntu-desktop

thank you my ubuntu was broken!! :)

ghost commented on Apr 29, 2021

edited by ghost

Very careful before using above command.
In case you successfully uninstalled default package, use below command ;)
sudo apt-get install ubuntu-desktop

thank you my ubuntu was broken!! :)

bro did you find a way to fix it, my ubuntu also broken because of 2nd command. It would be grateful if you can help me with this.

Very careful before using above command.
In case you successfully uninstalled default package, use below command ;)
sudo apt-get install ubuntu-desktop

thank you my ubuntu was broken!! :)

bro did you find a way to fix it, my ubuntu also broken because of 2nd command. It would be grateful if you can help me with this.

I just used this command to fix ubuntu :
sudo apt-get install ubuntu-desktop

Very careful before using above command.
In case you successfully uninstalled default package, use below command ;)
sudo apt-get install ubuntu-desktop

Thank you!
My ubuntu was also broken

Destroyed my linux purging python, be careful

sudo apt-get purge ..... destroys dependencies . Be careful .

sudo apt-get install ubuntu-desktop
helps recover dependencies but not all

This is NOT the way to. do this.!

You will trash your system if you start purging like this.

Thank you for this. I had installed python3.10, it was causing problems and I couldn't uninstall it through rm. I am still fairly new to linux so thank you.

yes, I've destroyed my computer and lost everything trying that, but my question still the same, how I can upgrade or deleted and then re-install the latest python version?

I use different python versions (3.8, 3.10) on my ubuntu. I decided to uninstall pythion3.10.
Now, anytime I install a package with pip, it is downloaded in 'python3.10/site-packages/' not 'python3.8/site-packages/'
Does anyone know how I can resolve this? I cannot also install packages in a venv because it is always installing globally to 'python3.10/site-packages/'

Please help. Thank you for your response

411A commented on Feb 3

edited

warningwarningwarningThese commands ruined the whole WSL Ubuntu successfully! warningwarningwarning
thank you!
for readers in the future: just try searching and use other methods.
to repair python2.7 on Ubuntu: sudo apt-get install --reinstall python2.7.

gammaSpeck commented on Feb 7

Note to self: Do not run commands on a github Gist without reading the comments section xD

I CANT BELIEVE UBUNTU CRASHED!! SUCH A FRAGILE USELESS OS

Some commands are best tried on virtual system first. Be careful.

chvmq commented on Aug 1

installed and have no graphical interface
sudo apt install --reinstall ubuntu-desktop fixed

I ran this command and I'm using a WSL with Ubutu... Any ideas on how I can fix mine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK