Erro ao desinstalar o virtualbox

1

Não consegui instalar nenhum pacote devido a este erro na caixa virtual. Então eu tentei esses comandos, mas também os mesmos erros.

sudo apt-get purge virtualbox*

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libgsoap8 libqt4-opengl libvncserver1 linux-headers-4.4.0-62
  linux-headers-4.4.0-62-generic linux-image-4.4.0-62-generic
  linux-image-extra-4.4.0-62-generic linux-signed-image-4.4.0-62-generic
  python3-systemd virtualbox-dkms
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  virtualbox*
0 upgraded, 0 newly installed, 1 to remove and 31 not upgraded.
1 not fully installed or removed.
After this operation, 64.1 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 332209 files and directories currently installed.)
Removing virtualbox (5.0.18-dfsg-2build1) ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing package virtualbox (--purge):
 subprocess installed pre-removal script returned error exit status 1
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 virtualbox
E: Sub-process /usr/bin/dpkg returned an error code (1)
    
por naveen tata 13.09.2017 / 18:21

2 respostas

0

Verifique se /usr/bin/python está vinculado ao python 2.7 e não, por exemplo, python 3.

Então

/usr/bin/python --version

deve produzir algo como o Python 2.7.12.

    
por Kees Beets 13.09.2017 / 19:45
0

tente reinstalá-lo com o seguinte comando:

$ sudo apt-get clean
$ sudo apt-get update
4 sudo apt-get install --reinstall python-minimal python-lockfile

e vinculando-o novamente a python2.7 em vez de python 3.x.

$ sudo rm /usr/bin/python
$ sudo ln -s /usr/bin/python2.7 /usr/bin/python
    
por Nullpointer 14.09.2017 / 13:09