2

Tengo una aplicación hecha en Django que ahora esta en modo producción en ubuntu server 16.04 y me falta es generar su Certificado SSL para que los usuarios puedan acceder mediante HTTPS,para ello me he guiado con este tutorial:

https://www.digitalocean.com/community/tutorials/how-to-set-up-let-s-encrypt-with-nginx-server-blocks-on-ubuntu-16-04

después de seguir los pasos que indica en el tutorial,el problema surgió cuando intente instalar certbot

sudo apt-get install python-certbot-nginx

me arroja este 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)

la verdad desconozco por que me sale ese error, detallo algunas herramientas y configuraciones del server:

  1. Mi Server solo esta optimizado únicamente por defecto para Python 3.5.2

  2. como herramientas estoy trabajando con NGINX, Uwsgi, django1.11, para servir estaticos,postgres como DB, virtualenv, respuesta correcta del dominio tanto por www y http... etc

sospecho quizá es requisito python 2.7?, ahora no puedo ni hacer upgrade, apt-get -f install y sudo apt autoremove, y me sale el mismo error

Quizá no estoy siguiendo bien la documentación? o que se puede hacer para instalar python-certbot-nginx?

NOTA: Los errores me arrojó en lineas arriba ya es del tercer intento de instalación. en algún intento de instalación me arrojó este 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).
5
  • He intentado instalar esos dependencias, pero me arroja el mismo error de arriba 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) el 4 ene. 2018 a las 15:30
  • intenta con esto sudo apt-get clean apt-get update el 4 ene. 2018 a las 18:37
  • chequea esta respuesta askubuntu.com/a/796521/717694 el 4 ene. 2018 a las 18:44
  • Si, era por la version de python le he cambiado globalmente a 2.7 y se ha instalado sin problemas, gracias por sus aportes el 5 ene. 2018 a las 21:16
  • Puedes Agregar tu respuesta? el 8 ene. 2018 a las 14:26

1 respuesta 1

1

Para instalar Certbot es requisito esencial tener como predeterminado python 2.7.x, en mi caso lo tenia python3.5 como predeterminado es por ello no podía instalar, tenia que cambiar la versión de Python en todo el sistema, en el terminal escribimos:

update-alternatives --install / usr / bin / python python /usr/bin/python2.7 1

update-alternatives --install / usr / bin / python python /usr/bin/python3.5 2

cuando verifico las versiones :

update-alternatives --list python

/usr/bin/python2.7
/usr/bin/python3.5

ahora simplemente selecciono cualquier version de Python con:

update-alternatives --config python

les saldra un selector de versiones como:

  Selección   Ruta                Prioridad  Estado
------------------------------------------------------------
  0            /usr/bin/python3.5   2         modo automático
* 1            /usr/bin/python2.7   1         modo manual
  2            /usr/bin/python3.5   2         modo manual

Press <enter> to keep the current choice[*], or type selection number: 

en mi caso lo tengo seleccionado opción 1, python2.7, y a proceder a instalar...

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.