I have made a big mess of my python installation, I would like to remove all the versions and do a clean install. How can I do that?
If I try the suggested:
sudo apt-get remove python2.7 --purge
I get:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
fontconfig iso-codes libaudio2 libdatrie1 libgstreamer-plugins-base0.10-0
libgstreamer0.10-0 libmng1 libmysqlclient18 libqt4-dbus libqt4-declarative
libqt4-designer libqt4-help libqt4-network libqt4-script libqt4-scripttools
libqt4-sql libqt4-sql-mysql libqt4-svg libqt4-test libqt4-xml
libqt4-xmlpatterns libqtassistantclient4 libqtcore4 libqtdbus4 libqtgui4
libqtwebkit4 libthai-data libthai0 libxrender1 libxt6 mysql-common qdbus
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
libpython2.7* python* python-bs4* python-chardet* python-cheetah*
python-imaging* python-lxml* python-mako* python-markupsafe* python-numpy*
python-openssl* python-picamera* python-pifacecommon*
python-pifacedigitalio* python-pip* python-pkg-resources* python-qt4*
python-rpi.gpio* python-serial* python-setuptools* python-sip*
python-support* python2.7*
0 upgraded, 0 newly installed, 23 to remove and 0 not upgraded.
24 not fully installed or removed.
After this operation, 55.3 MB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 44069 files and directories currently installed.)
Removing python-qt4 ...
Segmentation fault
dpkg: error processing python-qt4 (--purge):
subprocess installed pre-removal script returned error exit status 139
Segmentation fault
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 139
Removing libpython2.7 ...
Purging configuration files for libpython2.7 ...
Removing python-rpi.gpio ...
Segmentation fault
dpkg: error processing python-rpi.gpio (--purge):
subprocess installed pre-removal script returned error exit status 139
Removing python-pifacedigitalio ...
Segmentation fault
dpkg: error processing python-pifacedigitalio (--purge):
subprocess installed pre-removal script returned error exit status 139
Removing python-pifacecommon ...
Segmentation fault
dpkg: error processing python-pifacecommon (--purge):
subprocess installed pre-removal script returned error exit status 139
Removing python-picamera ...
Segmentation fault
dpkg: error processing python-picamera (--purge):
subprocess installed pre-removal script returned error exit status 139
dpkg: error processing python-openssl (--purge):
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
Removing python-numpy ...
Segmentation fault
dpkg: error processing python-numpy (--purge):
subprocess installed pre-removal script returned error exit status 139
Removing python-support ...
Purging configuration files for python-support ...
Removing python-sip ...
Segmentation fault
dpkg: error processing python-sip (--purge):
subprocess installed pre-removal script returned error exit status 139
dpkg: error processing python-pip (--purge):
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
Removing python-setuptools ...
Segmentation fault
dpkg: error processing python-setuptools (--purge):
subprocess installed pre-removal script returned error exit status 139
Removing python-serial ...
Segmentation fault
dpkg: error processing python-serial (--purge):
subprocess installed pre-removal script returned error exit status 139
Removing python-pkg-resources ...
Segmentation fault
dpkg: error processing python-pkg-resources (--purge):
subprocess installed pre-removal script returned error exit status 139
Removing python-mako ...
Segmentation fault
dpkg: error processing python-mako (--purge):
subprocess installed pre-removal script returned error exit status 139
Removing python-markupsafe ...
Segmentation fault
dpkg: error processing python-markupsafe (--purge):
subprocess installed pre-removal script returned error exit status 139
Removing python-lxml ...
Segmentation fault
dpkg: error processing python-lxml (--purge):
subprocess installed pre-removal script returned error exit status 139
Removing python-imaging ...
Segmentation fault
dpkg: error processing python-imaging (--purge):
subprocess installed pre-removal script returned error exit status 139
dpkg: error processing python-cheetah (--purge):
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
Removing python-chardet ...
Segmentation fault
dpkg: error processing python-chardet (--purge):
subprocess installed pre-removal script returned error exit status 139
Removing python-bs4 ...
Segmentation fault
dpkg: error processing python-bs4 (--purge):
subprocess installed pre-removal script returned error exit status 139
Removing python ...
Purging configuration files for python ...
Removing python2.7 ...
Purging configuration files for python2.7 ...
Processing triggers for man-db ...
Processing triggers for menu ...
Processing triggers for desktop-file-utils ...
Errors were encountered while processing:
python-qt4
python-rpi.gpio
python-pifacedigitalio
python-pifacecommon
python-picamera
python-openssl
python-numpy
python-sip
python-pip
python-setuptools
python-serial
python-pkg-resources
python-mako
python-markupsafe
python-lxml
python-imaging
python-cheetah
python-chardet
python-bs4
E: Sub-process /usr/bin/dpkg returned an error code (1)