Как удалить python linux

zhensongren / uninstall_python3.MD

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

⚠ ⚠ ⚠ These commands ruined the whole WSL Ubuntu successfully! ⚠ ⚠ ⚠
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 .

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.

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?

yall really testing these commands on your laptops ? what docker or vm did to you to hate using it so much

Very nice. I just blew my VM. Thanks for nothing.

What the hell, my terminal got removed

Ye kisne de diye baccho ke haath mein laptop

1st result when searching «ubuntu uninstall python» lmao

Читайте также:  Linux mint virtual machines

Thank you! My ubuntu was also broken 😅

Don’t try it or will distroy Your ubuntu

too late to read the comments

Thank you. I Just destroyed my ubuntu server

Destroyed my entire fing Ubuntu install, If anyone sees this comment, I would highly advise against using these commands, It will trash your system, if you fall victim to this, enter TTY console if you can, and type sudo apt-get update —fix-missing, then once this finishes, enter sudo apt install -f, this will fix the Ubuntu install, if it doesn’t you work you must reinstall Ubuntu somehow. For me, this method worked.

You can’t perform that action at this time.

Источник

Uninstall Python in Ubuntu

Uninstall Python in Ubuntu

  1. Check if Python Installed in Your System
  2. Ways to Remove/Uninstall Python in Ubuntu

This article demonstrates how to delete or uninstall Python from Ubuntu.

Check if Python Installed in Your System

Open the Terminal using Ctrl + Alt + T .
After opening the terminal, check whether your system has python installed or not by using the command python3 —version .
If the command replies with the specific version of python, then leave it because you have already installed python on your pc/desktop.
If the command replies with Command not found , then to install python, write the command sudo apt install python3 .

There are many ways for its uninstallation depending upon a user’s needs. Different commands in the terminal do different tasks.

If there is only a need to delete specific dependencies related to a specific module of python or if there is a need to delete all the dependencies or to remove the Python3 package.

Depending upon the specific needs and requirements, the user can run the commands in the terminal for specific actions.

Ways to Remove/Uninstall Python in Ubuntu

Uninstall/Delete a Specific Version

Suppose a user wants to delete a specific version of Python installed on the Ubuntu machine. Run the below command and enter your user password. The version of Python will be removed from the machine.

sudo apt purge python-minimal 

Remove Only the python3 Package

If a user wants to remove the specific package of Python, i.e., python 3.5 , run the below command and select and remove the python3 packages.

sudo apt-get remove python3.5 

Remove Packages With Their Dependencies

Suppose you want to remove a package and all the dependencies related to that package, run the below-mentioned command, enter your ubuntu password, and the package will be removed along with its dependencies.

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

Remove Settings, Configs, Datafiles Collectively

Suppose a user wants to remove all the configurations and settings or data files related to a python package. In that case, he should mention the below command in the terminal and enter the machine’s password to continue.

sudo apt-get purge python3.5 

Remove Configs, Data Files, and Dependencies of python3.5

If a user wants to collectively remove any Python package’s configuration, files, and dependencies, then the user must use the below command.

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

Hello! I am Salman Bin Mehmood(Baum), a software developer and I help organizations, address complex problems. My expertise lies within back-end, data science and machine learning. I am a lifelong learner, currently working on metaverse, and enrolled in a course building an AI application with python. I love solving problems and developing bug-free software for people. I write content related to python and hot Technologies.

Источник

How to completely uninstall python 2.7.13 on Ubuntu 16.04

I installed Python 2.7.13 on Ubuntu 16.04 according to this guide, and it became the default version as an alternative to the version 2.7.12. But, I wanted to completely remove Python 2.7.13 and return back to the version 2.7.12 as the default version since the pip command does not work with the following error.

bash: /usr/local/bin/pip: /usr/bin/python: bad interpreter: No such file or directory 

Could you please help me how to completely remove Python 2.7.13 from Ubuntu 16.04? Otherwise, could you please suggest how to fix the above error?

before doing anything else i suggest you run $ sudo apt install —reinstall python python-apt python2.7-minimal ; ubuntu relies on a working python2 installation! and your question might be better suited here: askubuntu.com

6 Answers 6

# Remove python2 sudo apt purge -y python2.7-minimal # You already have Python3 but # don't care about the version sudo ln -s /usr/bin/python3 /usr/bin/python # Same for pip sudo apt install -y python3-pip sudo ln -s /usr/bin/pip3 /usr/bin/pip # Confirm the new version of Python: 3 python --version 

In my case, instead of sudo apt purge -y python2.7-minimal this sudo apt purge python2.7-minimal worked!! But after pressing Enter key I have to type Yes, do as I say! N.B. I’m using this in Linux Mint 19.3 not Ubuntu. Thanks @Benoit Mrx

Yes!! But simple it did not word using -y!! Idk why but it worked only giving permission by retyping the confirm string Yes, do as I say!

caution : It is not recommended to remove the default Python from Ubuntu, it may cause GDM(Graphical Display Manager, that provide graphical login capabilities) failed.

To completely uninstall Python2.x.x and everything depends on it. use this command:

sudo apt purge python2.x-minimal 

As there are still a lot of packages that depend on Python2.x.x. So you should have a close look at the packages that apt wants to remove before you let it proceed.

Thanks, I hope it will be helpful for you.

try following to see all instances of python

whereis python which python 

Then remove all instances using:

sudo apt autoremove python 

repeat sudo apt autoremove python(for all versions) that should do it, then install Anaconda and manage Pythons however you like if you need to reinstall it.

can’t uninstall in a such way. anyway it’s remain in the system. sudo apt autoremove python Reading package lists. Done Building dependency tree Reading state information. Done Package ‘python’ is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded. then again: sudo apt remove python2.7 then: python —version output: Python 2.7.12

this command removed some of the dependencies of my GUI and made my ubuntu-desktop stop working, this also removed google-chrome-stable and another packages. I really don’t know why I run it, heheh

If I’m not wrong autoremove will remove the packages or dependencies which are no longer needed in the environment.

sudo apt purge python2.7-minimal 

Sometimes you need to first update the apt repo list.

sudo apt-get update sudo apt purge python2.7-minimal 

This is what I have after doing purge of all the python versions and reinstalling only 3.6.

root@esp32:/# python Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) [GCC 6.2.0 20161005] on linux Type "help", "copyright", "credits" or "license" for more information. >>> root@esp32:/# python3 Python 3.8.0 (default, Dec 15 2019, 14:19:02) [GCC 6.2.0 20161005] on linux Type "help", "copyright", "credits" or "license" for more information. 

Also the pip and pip3 commands are totally f up:

root@esp32:/# pip Traceback (most recent call last): File "/usr/local/bin/pip", line 7, in from pip._internal.cli.main import main File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 60 sys.stderr.write(f"ERROR: ") ^ SyntaxError: invalid syntax root@esp32:/# pip3 Traceback (most recent call last): File "/usr/local/bin/pip3", line 7, in from pip._internal.cli.main import main File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 60 sys.stderr.write(f"ERROR: ") ^ SyntaxError: invalid syntax 

I am totally noob at Linux, I just wanted to update Python from 2.x to 3.x so that Platformio could upgrade and now I messed up everything it seems.

Источник

How to Uninstall Python

We may want to remove Python in our Linux or Windows systems for different reasons – conflicting packages and the need for a given Python version are some top reasons. Unlike in Windows, Python is a core program in most Linux distributions. In this case, uninstalling Python without utmost care may cause your Linux system to break. This article focuses on how we can safely remove Python from Windows and Linux systems.

How to Uninstall Python in Linux

Most Linux distros come with Python installed. In fact, in most cases, the default Python coming with the operating system is a core package for the system such that if it is removed, the graphical display manager breaks down, among other awful things. Other Python version(s) can also be installed alongside Linux-inbuilt Python (we will discuss how to do this later). We can safely remove the Python built from the source, but removing the Python that came with the distribution is not recommended.

To uninstall Python installed from the source, follow these steps:

Step A. First of all, check all the Python versions installed using the whereis command in Linux

From Figure 1, what we are after are the binaries. They are located at bin/or local/bin. The inbuilt Python is in bin/, whereas the Python built from the source is mainly installed at the local/bin. In our case, we have Python3.9 (inbuilt – we don’t want to uninstall this) and Python3.6 located in local/bin directory, and we can safely remove it.

The following list can fully explain the Linux directories we are interested in:

  • /bin – binary or executable programs.
  • /lib – it contains kernel modules and a shared library.
  • /usr – user-related programs.
  • The /usr/local directory is where locally compiled applications are installed by default, preventing them from mucking up the rest of the system.
  • /etc – system configuration files.

Many programs in most Linux distributions depend on pre-installed Python. You can identify the default Python by running python on the terminal. You can also find it by using which command.

If we take a closer look at the long listing of /usr/bin you will realize that Python and its dependencies are linked to other programs.

Источник

Оцените статью
Adblock
detector