0

When trying to use the following command to setup my certs:

./letsencrypt-auto --apache -d example.com

I get this error from Python:

dpkg: dependency problems prevent configuration of python-virtualenv:
 python-virtualenv depends on python-pkg-resources; however:
  Package python-pkg-resources is not configured yet.
 python-virtualenv depends on python-setuptools; however:
  Package python-setuptools is not configured yet.
 python-virtualenv depends on python (>= 2.7); however:
  Package python is not configured yet.
 python-virtualenv depends on python (<< 2.8); however:
  Package python is not configured yet.
 python-virtualenv depends on python:any (>= 2.7.1-0ubuntu2); however:
  Package python is not configured yet.

dpkg: error processing package python-virtualenv (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python-minimal
 python
 python-dev
 python-pkg-resources
 python-setuptools
 python-virtualenv
E: Sub-process /usr/bin/dpkg returned an error code (1)

Leads to a rabbit hole of issues. I try: sudo dpkg --configure python but apparently Python-minimal isn't configured either. Try "sudo dpkg --configure python-minimal" and get the following:

Setting up python-minimal (2.7.5-5ubuntu3) ...
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

I've tried removing all of them and reinstalling with no success.

1 Answers1

0

Solved my issue, this thread had the answer: https://ubuntuforums.org/showthread.php?t=2333185

Edit the following file.

nano /var/lib/dpkg/info/python-minimal.postinst

From

#! /bin/sh
set -e


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

to

#! /bin/sh
set -e


python -m compileall /usr/share/python/ >/dev/null

Then

apt-get install python2.7-minimal