I faced issues when upgrading Ubuntu 16.04 (I don't remember exactly,
maybe from 16.04.3 to 16.04.4). At end of the upgrade it showed
following error:

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)

It started showing Broken Package error in Ubuntu so I thought re-installing 
python would fix this issue, but it uninstalled python with all python packages 
and all softwares which depends on any python library, for example gimp, kicad, 
kde, oxygen-icon-theme, pycharm etc (list is very long). 
Now when ever I try to install python:

sudo apt-get install python

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python-minimal 
python2.7 python2.7-minimal
Suggested packages:
  python-doc python-tk python2.7-doc
The following NEW packages will be installed:
  libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python 
python-minimal python2.7 python2.7-minimal
0 upgraded, 7 newly installed, 0 to remove and 21 not upgraded.
Need to get 1,628 kB/3,877 kB of archives.
After this operation, 16.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 
libpython2.7-minimal amd64 2.7.12-1ubuntu0~16.04.3 [340 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 
python2.7-minimal amd64 2.7.12-1ubuntu0~16.04.3 [1,261 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 
python-minimal amd64 2.7.12-1~16.04 [28.1 kB]                 
Fetched 1,628 kB in 6s (248 kB/s)                                               
                                                  
Selecting previously unselected package libpython2.7-minimal:amd64.
(Reading database ... 250996 files and directories currently installed.)
Preparing to unpack .../libpython2.7-minimal_2.7.12-1ubuntu0~16.04.3_amd64.deb 
...
Unpacking libpython2.7-minimal:amd64 (2.7.12-1ubuntu0~16.04.3) ...
Selecting previously unselected package python2.7-minimal.
Preparing to unpack .../python2.7-minimal_2.7.12-1ubuntu0~16.04.3_amd64.deb ...
Unpacking python2.7-minimal (2.7.12-1ubuntu0~16.04.3) ...
Selecting previously unselected package python-minimal.
Preparing to unpack .../python-minimal_2.7.12-1~16.04_amd64.deb ...
Unpacking python-minimal (2.7.12-1~16.04) ...
Selecting previously unselected package libpython2.7-stdlib:amd64.
Preparing to unpack .../libpython2.7-stdlib_2.7.12-1ubuntu0~16.04.3_amd64.deb 
...
Unpacking libpython2.7-stdlib:amd64 (2.7.12-1ubuntu0~16.04.3) ...
Selecting previously unselected package python2.7.
Preparing to unpack .../python2.7_2.7.12-1ubuntu0~16.04.3_amd64.deb ...
Unpacking python2.7 (2.7.12-1ubuntu0~16.04.3) ...
Selecting previously unselected package libpython-stdlib:amd64.
Preparing to unpack .../libpython-stdlib_2.7.12-1~16.04_amd64.deb ...
Unpacking libpython-stdlib:amd64 (2.7.12-1~16.04) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.1) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Setting up libpython2.7-minimal:amd64 (2.7.12-1ubuntu0~16.04.3) ...
Setting up python2.7-minimal (2.7.12-1ubuntu0~16.04.3) ...
Linking and byte-compiling packages for runtime python2.7...
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)

Please help me! Due to this I'm not able to install any of the softwares
in Ubuntu.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to python-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/1750586

Title:
  package python-minimal 2.7.12-1~16.04 failed to install/upgrade:
  subprocess installed post-installation script returned error exit
  status 1

Status in python-defaults package in Ubuntu:
  Confirmed

Bug description:
  There seems to be a dependency snarl:

  python-minimal is already the newest version (2.7.12-1~16.04).
  python-minimal set to manually installed.
  You might want to run 'apt-get -f install' to correct these:
  The following packages have unmet dependencies:
   python : PreDepends: python-minimal (= 2.7.11-1) but 2.7.12-1~16.04 is to be 
installed
   python-all : Depends: python (= 2.7.12-1~16.04) but 2.7.11-1 is to be 
installed
   python-all-dev : Depends: python (= 2.7.12-1~16.04) but 2.7.11-1 is to be 
installed
                    Depends: libpython-all-dev (= 2.7.12-1~16.04) but 2.7.11-1 
is to be installed
   python-dev : Depends: python (= 2.7.12-1~16.04) but 2.7.11-1 is to be 
installed
                Depends: libpython-dev (= 2.7.12-1~16.04) but 2.7.11-1 is to be 
installed
  E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify 
a solution).

  apt-get -f install tries to set up python-minimal (2.7.12-1~16.04) and
  returns 1.

  ProblemType: Package
  DistroRelease: Ubuntu 16.04
  Package: python-minimal 2.7.12-1~16.04
  ProcVersionSignature: Ubuntu 4.4.0-109.132-generic 4.4.98
  Uname: Linux 4.4.0-109-generic x86_64
  NonfreeKernelModules: nvidia_uvm nvidia
  ApportVersion: 2.20.1-0ubuntu2.15
  Architecture: amd64
  Date: Tue Feb 20 08:48:01 2018
  DuplicateSignature:
   package:python-minimal:2.7.12-1~16.04
   Setting up python-minimal (2.7.12-1~16.04) ...
   dpkg: error processing package python-minimal (--configure):
    subprocess installed post-installation script returned error exit status 1
  ErrorMessage: subprocess installed post-installation script returned error 
exit status 1
  InstallationDate: Installed on 2016-10-23 (484 days ago)
  InstallationMedia: Ubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64 
(20160719)
  RelatedPackageVersions:
   dpkg 1.18.4ubuntu1.3
   apt  1.2.25
  SourcePackage: python-defaults
  Title: package python-minimal 2.7.12-1~16.04 failed to install/upgrade: 
subprocess installed post-installation script returned error exit status 1
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-defaults/+bug/1750586/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to