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

Bug #1750586 reported by Stephan Samuel
72
This bug affects 15 people
Affects Status Importance Assigned to Milestone
python-defaults (Ubuntu)
Confirmed
Undecided
Unassigned

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)

Revision history for this message
Stephan Samuel (ssamuel) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-defaults (Ubuntu):
status: New → Confirmed
Revision history for this message
Stephen Pape (srpape) wrote :

The post installation file /var/lib/dpkg/info/python-minimal.postinst runs the following command:

python2.7 -m compileall /usr/share/python/ >/dev/null

Running the command manually (without the /dev/null redirect) produces the following error for me:

Compiling /usr/share/python/rekall-forensic/lib/python2.7/site-packages/pexpect/async.py ...
  File "/usr/share/python/rekall-forensic/lib/python2.7/site-packages/pexpect/async.py", line 16
    transport, pw = yield from asyncio.get_event_loop()\
                             ^
SyntaxError: invalid syntax

I removed the /usr/share/python/rekall-forensic folder and was able to "apt install -f". Likely a different package is causing you trouble, but try running that command for more information.

Revision history for this message
Mattias (mattiask) wrote :

Thank you Stephen, your solution worked for me too. A different package as you expected, but removing the folder seems to have resolved my issues.

Revision history for this message
Stephan Samuel (ssamuel) wrote :

Thanks, Stephen.

I had the same results as Mattias, mine was datapulley instead of rekall-forensic. Your direction of running the compile without the redirect so I could see the output was what got me there.

FWIW, datapulley seemed to be the only package in that folder. Is yours the same? (Mattias, same question for you.) Considering how much... uh... stuff I have installed and how integral Python is to Ubuntu it would seem to me that there would be more; maybe some folks didn't take a hint that they should be doing a thing a certain way. Perhaps this is somewhat more systemic? I don't know enough about Python or its package management to even start diagnosing something like this.

I'm filing with datapulley, which broke my apt.

Revision history for this message
Mattias (mattiask) wrote :

I have three packages under /usr/share/python, I think they are all company specific packages.

Revision history for this message
Saurav Kumar (saur-k10) wrote :
Download full text (5.0 KiB)

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.
Prepa...

Read more...

Saurav Kumar (saur-k10)
Changed in python-defaults (Ubuntu):
status: Confirmed → In Progress
status: In Progress → Confirmed
Revision history for this message
Arun Soman (arunnediyasala) wrote :

Thanks Stephen.
As per your note I removed the /usr/share/python/rekall-forensic folder then it is worked for me 2 days I spend for finding out a solution thanks for your help...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.