erro ao instalar o nginx

0

Estou tentando instalar o nginx, mas recebi este erro.

ahmed@ahmed-Inspiron-5537:~$ sudo apt-get install nginx
[sudo] password for ahmed: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
nginx is already the newest version (1.10.3-1ubuntu3).
The following packages were automatically installed and are no longer required:
  linux-headers-4.10.0-19 linux-headers-4.10.0-19-generic
  linux-image-4.10.0-19-generic linux-image-extra-4.10.0-19-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 2 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.10.3-1ubuntu3) ...
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.
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2017-06-09 15:49:00 +04; 10ms ago
     Docs: man:nginx(8)
  Process: 13214 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
  Process: 13202 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
      CPU: 26ms

يون 09 15:48:58 ahmed-Inspiron-5537 nginx[13214]: nginx: [emerg] …e)
يون 09 15:48:59 ahmed-Inspiron-5537 nginx[13214]: nginx: [emerg] …e)
يون 09 15:48:59 ahmed-Inspiron-5537 nginx[13214]: nginx: [emerg] …e)
يون 09 15:48:59 ahmed-Inspiron-5537 nginx[13214]: nginx: [emerg] …e)
يون 09 15:48:59 ahmed-Inspiron-5537 nginx[13214]: nginx: [emerg] …e)
يون 09 15:49:00 ahmed-Inspiron-5537 nginx[13214]: nginx: [emerg] …()
يون 09 15:49:00 ahmed-Inspiron-5537 systemd[1]: nginx.service: Co…=1
يون 09 15:49:00 ahmed-Inspiron-5537 systemd[1]: Failed to start A…r.
يون 09 15:49:00 ahmed-Inspiron-5537 systemd[1]: nginx.service: Un…e.
يون 09 15:49:00 ahmed-Inspiron-5537 systemd[1]: nginx.service: Fa…'.
Hint: Some lines were ellipsized, use -l to show in full.
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.10.3-1ubuntu3.1~) | nginx-full (<< 1.10.3-1ubuntu3.1~) | nginx-light (<< 1.10.3-1ubuntu3.1~) | nginx-extras (<< 1.10.3-1ubuntu3.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.
 nginx depends on nginx-core (>= 1.10.3-1ubuntu3) | nginx-full (>= 1.10.3-1ubuntu3) | nginx-light (>= 1.10.3-1ubuntu3) | nginx-extras (>= 1.10.3-1ubuntu3); 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)
    
por darking050 09.06.2017 / 13:53

2 respostas

1

Você também pode tentar executando o seguinte comando:

  1. Obtenha a lista de todos os pacotes Nginx instalados

    dpkg -l | grep nginx
    
  2. Remova todos os pacotes do nginx executando o seguinte comando:

    apt-get --purge autoremove nginx-* 
    

    ou

    apt-get --purge autoremove <packages listed in ouput of 1>
    

Os comandos acima irão remover todas as dependências do Nginx. Além disso, verifique se /var/lib/nginx e /etc/nginx são excluídos ou não. Se não for removido, removeu os diretórios executando o seguinte comando:

rm -rf /var/lib/nginx /etc/nginx
    
por Bidyut 22.08.2017 / 08:27
0
% bl0ck_qu0te%

Também diz:

% bl0ck_qu0te%

Então você deve tentar:

sudo apt purge nginx

E então:

sudo apt install nginx

Ao fazer isso, você desinstala completamente o nginx e depois o reinstala.

Deixe-me saber se funciona :),
Wessel

    
por GamingWessel 09.06.2017 / 14:30