Python update issue and broken packages

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
greenleafone7
Level 1
Level 1
Posts: 8
Joined: Sat Feb 24, 2018 5:53 am

Python update issue and broken packages

Post by greenleafone7 »

Two days ago I encountered an issue while trying to run the software updater.

Code: Select all

Setting up python-minimal (2.7.12-1~16.04) ...
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/runpy.py", line 174, 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)
    A package failed to install.  Trying to recover:
    dpkg: dependency problems prevent configuration of python-dev:
     python-dev depends on python (= 2.7.12-1~16.04); however:
      Version of python on system is 2.7.11-1.

    dpkg: error processing package python-dev (--configure):
     dependency problems - leaving unconfigured
    Setting up python-minimal (2.7.12-1~16.04) ...
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/runpy.py", line 174, 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-dev
     python-minimal
Fix broken packages does not solve the issue, and I cant perform any other updates anymore, since I always get the above error.

I am using

Code: Select all

4.4.0-66-generic #87-Ubuntu SMP Fri Mar 3 15:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
and using the following repos

Code: Select all

Repos:     Active apt sources in file: /etc/apt/sources.list.d/cuda-8-0-local-ga2.list
           deb file:///var/cuda-repo-8-0-local-ga2 /
           Active apt sources in file: /etc/apt/sources.list.d/google-chrome.list
           deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
           Active apt sources in file: /etc/apt/sources.list.d/official-package-repositories.list
           deb http://mirror.zetup.net/linuxmint/packages sarah main upstream import backport
           deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
           deb http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
           deb http://archive.canonical.com/ubuntu/ xenial partner
           Active apt sources in file: /etc/apt/sources.list.d/postgresql.list
           deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main
           Active apt sources in file: /etc/apt/sources.list.d/steam.list
           deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
           deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
           Active apt sources in file: /etc/apt/sources.list.d/ubuntu-toolchain-r-test-xenial.list
           deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main
           deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main
           Active apt sources in file: /etc/apt/sources.list.d/yarn.list
           deb https://dl.yarnpkg.com/debian/ stable main
If I cannot update python to the latest version because python-dev that is needed for the update requires that python already is at that latest version, then how can I update python? :P
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Locked

Return to “Software & Applications”