On Debian 8 jessie I've removed python:

perry@perry:~$ sudo apt-get remove python
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'python2.7' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 35 not upgraded.

But somehow I can still launch python from the terminal.

perry@perry:~$ python
Python 2.7.9 (default, Apr 29 2015, 18:34:06) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

I haven't installed it from source or from any other place but apt. How is this possible and how can I remove python completely?

  • 4
    what does which python say? Commented May 14, 2015 at 11:20
  • 5
    As Thomas says, you've not actually removed Python - and in all honesty, you really don't want to. Doing so will render your system unusable and in need of a reinstall.
    – John
    Commented May 14, 2015 at 11:40
  • 1
    @John: What debian internals are at all dependent on python? I'm not running Ubuntu...
    – Perry
    Commented May 14, 2015 at 11:45
  • 2
    Whats the output of dpkg --get-selections | grep "python2.7" ?
    – heemayl
    Commented May 14, 2015 at 11:46
  • 7
    No core package in Debian depends on Python; if apt lets you remove the package without going through hoops then it's safe to do so. Commented May 14, 2015 at 12:39

4 Answers 4


It turned out that the additional package python-minimal had python installed. One does then not only have to do:

sudo apt-get remove python

but also:

sudo apt-get remove python-minimal
  • 4
    As python is dependent on python-minimal, you could have removed python-minimal directly. You can also remove multiple packages at once, by specifying multiple package names on the command line.
    – jhominal
    Commented May 15, 2015 at 8:04

Unfortunately, I have no Debian at hand to test, but anyway:

I think you did not really uninstall python. Package 'python2.7' is not installed, so not removed only means that a package python2.7 is not installed. But perhaps the name is different.

which python says /usr/bin/python. That is a clear sign that you have python installed. Here is the official package.

dpkg-query -l 'python*' should help in getting the name/version of the installed package.

apt-rdepends should tell you which packages rely on python.


You should probably look at the output of dpkg --get-selections | grep python to see all the installed python packages. There are a few packages for various different releases that may be installed on a system. Keep in mind that python is in the standard selections, so fully removing it will also remove other 'standard' packages like reportbug.



sudo apt-get purge python-minimal

The above command show remove python entirely from your system.

You must log in to answer this question.

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