I have an application made in Django that is now in production mode in ubuntu server 16.04 and I need to generate its SSL Certificate so that users can access through HTTPS, for this I have guided myself with this tutorial:
After following the steps indicated in the tutorial, the problem arose when trying to install certbot
sudo apt-get install python-certbot-nginx
I get this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-certbot-nginx is already the newest version (0.19.0-1+ubuntu16.04.1+certbot+1).
The following packages were automatically installed and are no longer required:
grub-pc-bin linux-headers-4.4.0-101 linux-headers-4.4.0-101-generic linux-headers-4.4.0-97 linux-headers-4.4.0-97-generic linux-headers-4.4.0-98
linux-headers-4.4.0-98-generic linux-image-4.4.0-101-generic linux-image-4.4.0-97-generic linux-image-4.4.0-98-generic
Use 'sudo apt autoremove' to remove them.
Suggested packages:
apport-gtk | apport-kde
The following packages will be upgraded:
apport
1 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
94 not fully installed or removed.
Need to get 0 B/121 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 174786 files and directories currently installed.)
Preparing to unpack .../apport_2.20.1-0ubuntu2.15_all.deb ...
File "/usr/bin/pyclean", line 63
except (IOError, OSError), e:
^
SyntaxError: invalid syntax
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
File "/usr/bin/pyclean", line 63
except (IOError, OSError), e:
^
SyntaxError: invalid syntax
dpkg: error processing archive /var/cache/apt/archives/apport_2.20.1-0ubuntu2.15_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/apport_2.20.1-0ubuntu2.15_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
the truth I do not know why I get that error, I detail some tools and server settings:
My Server is only optimized by default for Python 3.5.2
as tools I am working with NGINX, Uwsgi, django1.11, to serve static, postgres like DB, virtualenv, correct domain response both by www and http ... etc
I suspect maybe python 2.7 is required, now I can not upgrade, apt-get -f install and sudo apt autoremove, and I get the same error
Maybe I'm not following the documentation well? or what can be done to install python-certbot-nginx?
NOTE: The errors I threw in lines up is already the third installation attempt. in some attempt of installation threw me this error:
Reading package lists...
Done Building dependency tree Reading state information...
Done python-certbot-nginx is already the newest version (0.19.0-1+ubuntu16.04.1+certbot+1).
You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies:
apport : Depends: python3-apport (>= 2.20.1-0ubuntu2.15) but 2.20.1-0ubuntu2.14 is to be installed E: Unmet dependencies.
Try 'apt-get -f install' with no packages (or specify a solution).