3

Every time I install something from the repository, towards the end of installation I get an error message like the following (eg: 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
14
  • Plase add the whole output of sudo apt-get install --reinstall gparted by editing your question.
    – A.B.
    Oct 14, 2015 at 9:20
  • The output of lsb_release -a
    – A.B.
    Oct 14, 2015 at 10:02
  • apt-cache policy apport
    – A.B.
    Oct 14, 2015 at 10:05
  • and sudo dpkg --configure -a
    – A.B.
    Oct 14, 2015 at 10:06
  • /usr/bin/python --version
    – A.B.
    Oct 14, 2015 at 10:10

1 Answer 1

7

You have installed an incompatible python version and this breaks the apt commands.

Therefore download some Python packages and install via the commands below

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

Remove some packages, because sudo apt-get install -f and sudo dpkg --congigure -a has no effect

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

Now reinstall them using the main server

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

1
  • What about when the py3compile is broken, hence breaking apt?
    – ixtmixilix
    Aug 4, 2023 at 20:21

You must log in to answer this question.

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