1

I'm trying to install some packages with apt-get but it seems to be stuck in some sort of dependency loop.

I have read similar questions/answers but none of the solutions given work.

This is the output and error messages of apt-get install -f. It looks like a problem with python? Any advice?

Many thanks.

sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  cdbs freepats gir1.2-gtksource-3.0 gir1.2-gucharmap-2.90 glib-networking-common gnustep-common gsettings-desktop-schemas gstreamer0.10-plugins-bad gstreamer0.10-x
  html2text libaa1 libao-common libao4 libass4 libaudio2 libavc1394-0 libblas-dev libbz2-dev libcaca0 libcdaudio1 libdc1394-22 libdca0 libdirectfb-1.2-9 libdv4 libdvdnav4
  libdvdread4 libenca0 libfaad2 libflite1 libgail-3-0 libgeoclue0 libgme0 libgraphite3 libgstreamer-plugins-bad0.10-0 libgucharmap-2-90-7 libiec61883-0 libjpeg8-dev
  libkate1 libkpathsea6 liblapack-dev liblcms1 libmhash2 libmimic0 libmms0 libmodplug1 libmpcdec6 libnotify4 libobjc4 libofa0 libopenal-data libopenal1 libopus0
  libpoppler19 libptexenc1 libraptor2-0 librasqal3 libraw1394-11 librdf0 libreadline-dev libshout3 libslv2-9 libsoundtouch0 libspandsp2 libtag1-vanilla libtag1c2a
  libts-0.0-0 libvo-aacenc0 libvo-amrwbenc0 libwavpack1 libwebkitgtk-3.0-common libwildmidi-config libwildmidi1 libxfont1 libyajl2 libyaml-tiny-perl libzbar0 libzvbi-common
  libzvbi0 lmodern luatex notification-daemon tex-common tex-gyre texlive-common texlive-doc-base texlive-fonts-recommended-doc texlive-latex-base-doc
  texlive-latex-recommended-doc texlive-pstricks-doc tsconf ttf-dejavu ttf-freefont ttf-marvosym xfonts-encodings xfonts-utils yelp-xsl zenity-common
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  aspell build-essential dictionaries-common dpkg-dev gir1.2-freedesktop gir1.2-glib-2.0 gobject-introspection ienglish-common ispell libalgorithm-diff-xs-perl
  libapt-pkg-perl libaspell15 libaugeas0 libauthen-pam-perl libbit-vector-perl libbsd-resource-perl libcairo-perl libclass-c3-xs-perl libclass-methodmaker-perl
  libclone-perl libconfig-augeas-perl libconvert-binary-c-perl libcrypt-ssleay-perl libcurses-perl libdata-alias-perl libdate-calc-xs-perl libdbd-mysql-perl libdbd-pg-perl
  libdbd-sqlite3-perl libdbi-perl libdpkg-perl libelfg0 libfcgi-perl libfile-fcntllock-perl libfuse-perl libgd-perl libgirepository-1.0-1 libgirepository1.0-dev
  libglib-perl libglib2.0-0 libglib2.0-bin libglib2.0-dev libio-pty-perl liblocale-gettext-perl libtext-iconv-perl patch perl-base python python-gi python-gi-cairo
Suggested packages:
  aspell-doc spellutils debian-keyring spell augeas-tools libfont-freetype-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl libunix-mknod-perl liblchown-perl
  libfilesys-statvfs-perl libgirepository1.0-doc diffutils-doc python-doc python-tk
Recommended packages:
  iamerican iamerican-small iamerican-large iamerican-huge iamerican-insane ibritish ibritish-small ibritish-large ibritish-huge ibritish-insane xdg-user-dirs
The following packages will be REMOVED:
  libgd-gd2-perl
The following NEW packages will be installed:
  aspell build-essential dictionaries-common dpkg-dev ienglish-common ispell libdpkg-perl libelfg0 libgd-perl libio-pty-perl libtext-iconv-perl
The following packages will be upgraded:
  gir1.2-freedesktop gir1.2-glib-2.0 gobject-introspection libalgorithm-diff-xs-perl libapt-pkg-perl libaspell15 libaugeas0 libauthen-pam-perl libbit-vector-perl
  libbsd-resource-perl libcairo-perl libclass-c3-xs-perl libclass-methodmaker-perl libclone-perl libconfig-augeas-perl libconvert-binary-c-perl libcrypt-ssleay-perl
  libcurses-perl libdata-alias-perl libdate-calc-xs-perl libdbd-mysql-perl libdbd-pg-perl libdbd-sqlite3-perl libdbi-perl libfcgi-perl libfile-fcntllock-perl libfuse-perl
  libgirepository-1.0-1 libgirepository1.0-dev libglib-perl libglib2.0-0 libglib2.0-bin libglib2.0-dev liblocale-gettext-perl patch perl-base python python-gi
  python-gi-cairo
39 upgraded, 11 newly installed, 1 to remove and 1067 not upgraded.
14 not fully installed or removed.
Need to get 0 B/17.7 MB of archives.
After this operation, 11.2 MB of additional disk space will be used.
Do you want to continue [Y/n]?
Reading changelogs... Done
Extracting templates from packages: 100%
Preconfiguring packages ...
 dict-common::dc_set: dictionaries-common/default-ispell is already set to
      [american (American English)]. Preserving it.
 dict-common::dc_set: dictionaries-common/default-wordlist is already set to
      [american (American English)]. Preserving it.
Setting up python-minimal (2.7.9-1) ...
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/compileall.py", line 16, in <module>
    import struct
  File "/usr/local/lib/python2.7/struct.py", line 1, in <module>
    from _struct import *
ImportError: No module named _struct
dpkg: error processing package python-minimal (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 python-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)

EDIT: As suggested I have tried to use apt-get to reinstall python-minimal and get the following errors

sudo apt-get install --reinstall python2.7-minimal
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libalgorithm-diff-xs-perl : Depends: perlapi-5.14.2
 libapt-pkg-perl : Depends: perlapi-5.14.2
 libbit-vector-perl : Depends: perlapi-5.14.2
 libbsd-resource-perl : Depends: perlapi-5.14.2
 libcairo-perl : Depends: perlapi-5.14.2
 libclass-c3-xs-perl : Depends: perlapi-5.14.2
 libclass-methodmaker-perl : Depends: perlapi-5.14.2
 libclone-perl : Depends: perlapi-5.14.2
 libconfig-augeas-perl : Depends: perlapi-5.14.2
 libconvert-binary-c-perl : Depends: perlapi-5.14.2
 libcrypt-ssleay-perl : Depends: perlapi-5.14.2
 libcurses-perl : Depends: perlapi-5.14.2
 libdata-alias-perl : Depends: perlapi-5.14.2
 libdate-calc-xs-perl : Depends: perlapi-5.14.2
 libdbd-mysql-perl : Depends: perlapi-5.14.2
 libdbd-pg-perl : Depends: perlapi-5.14.2
 libdbd-sqlite3-perl : Depends: perlapi-5.14.2
 libdbi-perl : Depends: perlapi-5.14.2
 libfcgi-perl : Depends: perlapi-5.14.2
 libfile-fcntllock-perl : Depends: perlapi-5.14.2
 libfuse-perl : Depends: perlapi-5.14.2
 libgd-gd2-perl : Depends: perlapi-5.14.2
 libglib-perl : Depends: perlapi-5.14.2
 liblocale-gettext-perl : PreDepends: perlapi-5.14.2
 python : Depends: python-minimal (= 2.7.3-4+deb7u1) but 2.7.9-1 is to be installed
 python-dev : Depends: python (= 2.7.9-1) but 2.7.3-4+deb7u1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 aspell-en : Depends: aspell (>= 0.60.3-2) but it is not installed
             Depends: dictionaries-common (>= 0.49.2) but it is not installed
 iamerican : Depends: dictionaries-common but it is not installed
             Depends: ienglish-common (= 3.3.02-6) but it is not installed
             Depends: ispell but it is not installed
 ibritish : Depends: dictionaries-common but it is not installed
            Depends: ienglish-common (= 3.3.02-6) but it is not installed
            Depends: ispell but it is not installed
 libalgorithm-diff-xs-perl : Depends: perlapi-5.14.2
 libapt-pkg-perl : Depends: perlapi-5.14.2
 libbit-vector-perl : Depends: perlapi-5.14.2
 libbsd-resource-perl : Depends: perlapi-5.14.2
 libcairo-perl : Depends: perlapi-5.14.2
 libclass-c3-xs-perl : Depends: perlapi-5.14.2
 libclass-methodmaker-perl : Depends: perlapi-5.14.2
 libclone-perl : Depends: perlapi-5.14.2
 libconfig-augeas-perl : Depends: perlapi-5.14.2
 libconvert-binary-c-perl : Depends: perlapi-5.14.2
 libcrypt-ssleay-perl : Depends: perlapi-5.14.2
 libcurses-perl : Depends: perlapi-5.14.2
 libdata-alias-perl : Depends: perlapi-5.14.2
 libdate-calc-xs-perl : Depends: perlapi-5.14.2
 libdbd-mysql-perl : Depends: perlapi-5.14.2
 libdbd-pg-perl : Depends: perlapi-5.14.2
 libdbd-sqlite3-perl : Depends: perlapi-5.14.2
 libdbi-perl : Depends: perlapi-5.14.2
 libfcgi-perl : Depends: perlapi-5.14.2
 libfile-fcntllock-perl : Depends: perlapi-5.14.2
 libfuse-perl : Depends: perlapi-5.14.2
 libgd-gd2-perl : Depends: perlapi-5.14.2
 libglib-perl : Depends: perlapi-5.14.2
 liblocale-gettext-perl : PreDepends: perlapi-5.14.2
 python : Depends: python-minimal (= 2.7.3-4+deb7u1) but 2.7.9-1 is installed
 python-dev : Depends: python (= 2.7.9-1) but 2.7.3-4+deb7u1 is installed
E: Unmet dependencies. Try using -f.

closed as off-topic by Jeff Schaller, Rui F Ribeiro, msp9011, Sparhawk, slm Aug 21 '18 at 6:56

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jeff Schaller, Rui F Ribeiro, msp9011, Sparhawk, slm
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Thank you for your suggestion. I have tried this and am still unable to fix the packages. – darigand Jul 11 '16 at 10:57
  • Rahul, I have tried to run those commands and get the errors which I have edited into my original question. Thank you for suggestion. – darigand Jul 11 '16 at 11:03
  • Ah I didn't see that – Rahul Jul 11 '16 at 11:04
  • I meant after you had suggested to try it. Any idea how to fix the perlapi dependancy? It is part of perl-base which I have manually reinstalled with dpkg but still get this error. – darigand Jul 11 '16 at 11:05
  • What distribution do you use (apt is used in several), and what repositories have you configured? – Henrik Jul 11 '16 at 11:47
1

The last line of your sources.list points to Jessie.

Wheezy was the previous stable release of Debian, Jessie is the current. And Wheezy now only gets very few updates.

When you just run apt-get install <package>, it will try to install the newest version it can find (unless you have some pinning set up, but if you have you should know about it, and should know enough about how apt works to never have ended up where you are, so I think it's safe to assume you haven't), that will almost always be from Jessie, but installing Jessie packages on Wheezy is asking for trouble.

As all lines but the last point to a mirror in Ireland, and the last line point to the us, it suggests that you might have added it without fully knowing what you were doing? Be careful, and read a little about maintaining a debian system.

As you probably already have Jessie packages on your system, the only sane way forward is to upgrade to Jessie. There are plenty of guides online, but in short:

  • Change wheezy to jessie everywhere in /etc/apt/sources.list
  • Run apt-get update
  • Run apt-get dist-upgrade

When editing sources.list you can just remove the last line.

  • Thank you Henrik, I will upgrade after I have done a bit more reading on maintaining the system as you suggested. – darigand Jul 11 '16 at 12:41
1

Looks like the problem was due to having a local version of python installed I was able to run the apt-get -f after removing the local python install and 'manually' installing python-minimal with dpkg. Thank you all for your input.

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