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?

  • 3
    what does which python say? – Thomas Junk May 14 '15 at 11:20
  • 4
    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 May 14 '15 at 11:40
  • 1
    @John: What debian internals are at all dependent on python? I'm not running Ubuntu... – Perry May 14 '15 at 11:45
  • 2
    Whats the output of dpkg --get-selections | grep "python2.7" ? – heemayl May 14 '15 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. – Stephen Kitt May 14 '15 at 12:39

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
  • 3
    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 May 15 '15 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.