10

I wanted to install version 3 of python and pip but instead issued

sudo apt-get install python-pip python-dev

how do I uninstall python and pip, I tried sudo apt-get uninstall but did not work, what is the correct command?

user402175
  • 101
  • 1
  • 1
  • 3
  • Just a note, on ubuntu you have python-pip and python3-pip, but they have different commands anyway. One is `pip` and the other is `pip3`. As such installing python-pip and python-dev is not detrimental. – mzhaase Feb 24 '17 at 08:19

2 Answers2

11

In order to remove it type:

sudo apt-get remove python-pip python-dev

If you're not sure which switch to use, you can add the --help switch to almost if not every Linux command to get details about the command.

Example:

apt-get --help
Itai Ganot
  • 10,424
  • 27
  • 88
  • 143
  • If you're on an aws ec2-instance you have to use yum. Anyone know the command using yum and not apt-get? – Kyle Bridenstine May 17 '18 at 18:59
  • 1
    @KyleBridenstine this is partially right, if you use aws ami of Amazon Linux then since it is based on Centos, then you use yum. The equivalent in Yum is: “yum remove package_name”. – Itai Ganot Sep 19 '18 at 15:16
  • "sudo yum remove python-pip python-dev" works fine for CentOS 7 – Drasius Jan 31 '20 at 15:07
4

to fully remove those you can use sudo apt purge python-pip python-dev <-- this will delete all the files/directories/binaries created by that package

Diego Velez
  • 780
  • 1
  • 6
  • 13