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?

1
  • 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, 2017 at 8:19

2 Answers 2

12

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
3
  • If you're on an aws ec2-instance you have to use yum. Anyone know the command using yum and not apt-get? May 17, 2018 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, 2018 at 15:16
  • "sudo yum remove python-pip python-dev" works fine for CentOS 7
    – Drasius
    Jan 31, 2020 at 15:07
5

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

Not the answer you're looking for? Browse other questions tagged .