Erro ao instalar qualquer coisa usando o apt-get

3

Toda vez que eu instalo algo do repositório, no final da instalação, recebo uma mensagem de erro como a seguinte (por exemplo: gparted) -

harish@harish-desktop:~$ sudo apt-get install --reinstall gparted
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libbonoboui2-0 libbonoboui2-common libcf0 libgnomecanvas2-0
  libgnomecanvas2-common libgnomeui-0 libgnomeui-common libmysqlclient18
  libnetcdf-dev libnetcdfc++4 libnetcdff5 libpq5 libswscale2 libvtk5.8
  linux-headers-3.19.0-25 linux-headers-3.19.0-25-generic
  linux-image-3.19.0-25-generic linux-image-extra-3.19.0-25-generic
  mysql-common python-chardet-whl python-colorama python-colorama-whl
  python-distlib python-distlib-whl python-gnome2 python-html5lib
  python-html5lib-whl python-keybinder python-pip python-pip-whl
  python-pyorbit python-requests-whl python-setuptools-whl python-six-whl
  python-urllib3-whl python-vtk python-wheel python-wxmpl tcl-vtk
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
8 not fully installed or removed.
Need to get 0 B/524 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 303324 files and directories currently installed.)
Preparing to unpack .../gparted_0.18.0-1_amd64.deb ...
Unpacking gparted (0.18.0-1) over (0.18.0-1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Setting up apport (2.14.1-0ubuntu3.15) ...
E: pycompile:233: Requested versions are not installed
dpkg: error processing package apport (--configure):
 subprocess installed post-installation script returned error exit status 3
dpkg: dependency problems prevent configuration of apport-gtk:
 apport-gtk depends on apport (>= 0.41); however:
  Package apport is not configured yet.

dpkg: error processing package apport-gtk (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Setting up apt-offline (1.3.1ubuntu0.1) ...
E: pycompile:233: Requested versions are not installed
dpkg: error processing package apt-offline (--configure):
 subprocess installed post-installation script returned error exit status 3
Setting up blueman (1.23-git201403102151-1ubuntu1) ...
E: pycompile:233: Requested versions are not installed
dpkg: error processing package blueman (--configure):
 subprocess installed post-installation script returned error exit status 3
No apport report written because MaxReports is reached already
                                                              Setting up gimp (2.8.10-0ubuntu1) ...
E: pycompile:233: Requested versions are not installed
dpkg: error processing package gimp (--configure):
 subprocess installed post-installation script returned error exit status 3
No apport report written because MaxReports is reached already
                                                              Setting up python-psutil (1.2.1-1ubuntu2) ...
E: pycompile:233: Requested versions are not installed
dpkg: error processing package python-psutil (--configure):
 subprocess installed post-installation script returned error exit status 3
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of light-locker-settings:
 light-locker-settings depends on python-psutil; however:
  Package python-psutil is not configured yet.

dpkg: error processing package light-locker-settings (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Setting up python-tz (2012c-1ubuntu0.1) ...
E: pycompile:233: Requested versions are not installed
dpkg: error processing package python-tz (--configure):
 subprocess installed post-installation script returned error exit status 3
No apport report written because MaxReports is reached already
                                                              Setting up gparted (0.18.0-1) ...
Errors were encountered while processing:
 apport
 apport-gtk
 apt-offline
 blueman
 gimp
 python-psutil
 light-locker-settings
 python-tz
E: Sub-process /usr/bin/dpkg returned an error code (1)

EDIT 1:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.3 LTS
Release:    14.04
Codename:   trusty

EDIT 2:

harish@harish-desktop:~/test$ apt-cache policy apport
apport:
  Installed: 2.14.1-0ubuntu3.15
  Candidate: 2.14.1-0ubuntu3.15
  Version table:
 *** 2.14.1-0ubuntu3.15 0
        500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
        100 /var/lib/dpkg/status
     2.14.1-0ubuntu3 0
        500 http://in.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

EDIT 3:

harish@harish-desktop:~/test$ sudo dpkg --configure -a
[sudo] password for harish: 
Setting up gimp (2.8.10-0ubuntu1) ...
E: pycompile:233: Requested versions are not installed
dpkg: error processing package gimp (--configure):
 subprocess installed post-installation script returned error exit status 3
Setting up python-tz (2012c-1ubuntu0.1) ...
E: pycompile:233: Requested versions are not installed
dpkg: error processing package python-tz (--configure):
 subprocess installed post-installation script returned error exit status 3
Setting up blueman (1.23-git201403102151-1ubuntu1) ...
E: pycompile:233: Requested versions are not installed
dpkg: error processing package blueman (--configure):
 subprocess installed post-installation script returned error exit status 3
Setting up python-psutil (1.2.1-1ubuntu2) ...
E: pycompile:233: Requested versions are not installed
dpkg: error processing package python-psutil (--configure):
 subprocess installed post-installation script returned error exit status 3
Setting up apport (2.14.1-0ubuntu3.15) ...
E: pycompile:233: Requested versions are not installed
dpkg: error processing package apport (--configure):
 subprocess installed post-installation script returned error exit status 3
Setting up apt-offline (1.3.1ubuntu0.1) ...
E: pycompile:233: Requested versions are not installed
dpkg: error processing package apt-offline (--configure):
 subprocess installed post-installation script returned error exit status 3
dpkg: dependency problems prevent configuration of apport-gtk:
 apport-gtk depends on apport (>= 0.41); however:
  Package apport is not configured yet.

dpkg: error processing package apport-gtk (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of light-locker-settings:
 light-locker-settings depends on python-psutil; however:
  Package python-psutil is not configured yet.

dpkg: error processing package light-locker-settings (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 gimp
 python-tz
 blueman
 python-psutil
 apport
 apt-offline
 apport-gtk
 light-locker-settings

EDIT 4:

harish@harish-desktop:~/test$ /usr/bin/python --version
Python 2.7.6

EDIT 5:

harish@harish-desktop:~/test$ head -n233 /usr/bin/pycompile | tail -1
log.error('Requested versions are not installed')

EDIT 6:

harish@harish-desktop:~/test$ apt-cache policy python-minimal
python-minimal:
  Installed: 2.7.5-5ubuntu3
  Candidate: 2.7.5-5ubuntu3
  Version table:
 *** 2.7.5-5ubuntu3 0
        500 http://in.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
    
por user35952 14.10.2015 / 11:02

1 resposta

6

Você instalou uma versão incompatível do python e isso quebra os comandos apt .

Portanto baixe alguns pacotes do Python e instale através dos comandos abaixo

mkdir ~/repair_python
cd ~/repair_python
apt-get download python2.7-minimal libpython2.7-minimal python-minimal python2.7
sudo dpkg -i --force-all *.deb

Remover alguns pacotes, porque sudo apt-get install -f e sudo dpkg --congigure -a não tem efeito

sudo apt-get remove gimp apport apport-gtk apt-offline blueman python-psutil light-locker-settings python-tz

Agora, reinstale-os usando o servidor principal

sudo sed -i 's/in.archive/archive/' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -f
sudo apt-get install gimp blueman light-locker-settings apport apport-gtk apt-offline
sudo apt-get install --reinstall gparted
sudo apt-get autoremove

    
por A.B. 14.10.2015 / 15:12