web-dev-qa-db-fra.com

Impossible d'installer nginx sur Ubuntu 16.04

J'ai vu des questions similaires posées pour la plupart non résolues. J'installe nginx après avoir arrêté le serveur Apache

dpkg: package de traitement des erreurs nginx-core (--configure): le script de post-installation installé du sous-processus a renvoyé le statut de sortie d'erreur 1

$ Sudo install nginx

Reading package lists... Done
Building dependency tree       
Reading state information... Done
nginx is already the newest version (1.9.15-0ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 25 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up nginx-core (1.9.15-0ubuntu1) ...
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
invoke-rc.d: initscript nginx, action "start" failed.
dpkg: error processing package nginx-core (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nginx:
 nginx depends on nginx-core (>= 1.9.15-0ubuntu1) | nginx-full (>= 1.9.15-0ubuntu1) | nginx-light (>= 1.9.15-0ubuntu1) | nginx-extras (>= 1.9.15-0ubuntu1); however:
  Package nginx-core is not configured yet.
  Package nginx-full is not installed.
  Package nginx-light is not installed.
  Package nginx-extras is not installed.
 nginx depends on nginx-core (<< 1.9.15-0ubuntu1.1~) | nginx-full (<< 1.9.15-0ubuntu1.1~) | nginx-light (<< 1.9.15-0ubuntu1.1~) | nginx-extras (<< 1.9.15-0ubuntu1.1~); however:
  Package nginx-core is not configured yet.
  Package nginx-full is not installed.
  Package nginx-light is not installed.
  Package nginx-extras is not installed.

dpkg: error processing package nginx (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
 nginx-core
 nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

Sortie après l'exécution de "systemctl status nginx.service"

nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: en
   Active: failed (Result: exit-code) since Fri 2017-05-26 12:50:30 IST; 3min 27
  Process: 21570 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (cod
  Process: 21566 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process

May 26 12:50:28 infinity nginx[21570]: nginx: [emerg] bind() to 0.0.0.0:80 faile
May 26 12:50:28 infinity nginx[21570]: nginx: [emerg] bind() to 0.0.0.0:80 faile
May 26 12:50:29 infinity nginx[21570]: nginx: [emerg] bind() to 0.0.0.0:80 faile
May 26 12:50:29 infinity nginx[21570]: nginx: [emerg] bind() to 0.0.0.0:80 faile
May 26 12:50:30 infinity nginx[21570]: nginx: [emerg] bind() to 0.0.0.0:80 faile
May 26 12:50:30 infinity nginx[21570]: nginx: [emerg] still could not bind()
May 26 12:50:30 infinity systemd[1]: nginx.service: Control process exited, code
May 26 12:50:30 infinity systemd[1]: Failed to start A high performance web serv
May 26 12:50:30 infinity systemd[1]: nginx.service: Unit entered failed state.
May 26 12:50:30 infinity systemd[1]: nginx.service: Failed with result 'exit-cod
lines 1-16/16 (END)

Sortie après l'exécution de "journalctl -xe"

-- 
-- Unit nginx.service has begun starting up.
May 26 12:50:28 infinity nginx[21570]: nginx: [emerg] bind() to 0.0.0.0:80 faile
May 26 12:50:28 infinity nginx[21570]: nginx: [emerg] bind() to 0.0.0.0:80 faile
May 26 12:50:29 infinity nginx[21570]: nginx: [emerg] bind() to 0.0.0.0:80 faile
May 26 12:50:29 infinity nginx[21570]: nginx: [emerg] bind() to 0.0.0.0:80 faile
May 26 12:50:30 infinity nginx[21570]: nginx: [emerg] bind() to 0.0.0.0:80 faile
May 26 12:50:30 infinity nginx[21570]: nginx: [emerg] still could not bind()
May 26 12:50:30 infinity systemd[1]: nginx.service: Control process exited, code
May 26 12:50:30 infinity systemd[1]: Failed to start A high performance web serv
-- Subject: Unit nginx.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit nginx.service has failed.
-- 
-- The result is failed.
May 26 12:50:30 infinity systemd[1]: nginx.service: Unit entered failed state.
May 26 12:50:30 infinity systemd[1]: nginx.service: Failed with result 'exit-cod
May 26 12:50:32 infinity Sudo[21514]: pam_unix(Sudo:session): session closed for
May 26 12:50:48 infinity pkexec[21608]: pam_unix(polkit-1:session): session open
May 26 12:50:48 infinity pkexec[21608]: pam_systemd(polkit-1:session): Cannot cr
May 26 12:50:48 infinity pkexec[21608]: mayuresh: Executing command [USER=root] 
lines 2095-2117/2117 (END)
1
YSsdatasks

J'ai finalement pu installer nginx après: j'ai désinstallé Apache2 et réinstallé dpkg après cette réponse

1
YSsdatasks