Пакет nginx-core еще не настроен.Подпроцесс:/user/bin / dpkg вернул код ошибки(1)

Я пытался установить sshв другого пользователя в моей ubuntu 16.04.Но я получил эту ошибку:

After this operation, 99.3 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 ssh all 1:7.2p2-4ubuntu2.1 [7,070 B]
Fetched 7,070 B in 2s (2,659 B/s)
Selecting previously unselected package ssh.
(Reading database ... 244468 files and directories currently installed.)
Preparing to unpack .../ssh_1%3a7.2p2-4ubuntu2.1_all.deb ...
Unpacking ssh (1:7.2p2-4ubuntu2.1) ...
Setting up nginx-core (1.10.0-0ubuntu0.16.04.4) ...
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.10.0-0ubuntu0.16.04.4) | nginx-full (>= 1.10.0-0ubuntu0.16.04.4) | nginx-light (>= 1.10.0-0ubuntu0.16.04.4) | nginx-extras (>= 1.10.0-0ubuntu0.16.04.4); 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.0-0ubuntu0.16.04.4.1~) | nginx-full (<< 1.10.0-0ubuntu0.16.04.4.1~) | nginx-light (<< 1.10.0-0ubuntu0.16.04.4.1~) | nginx-extras (<< 1.10.0-0ubuntu0.16.04.4.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
Setting up ssh (1:7.2p2-4ubuntu2.1) ...
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)

Любая помощь будет оценена.

3 ответа

  1. В моем случае причина была

    -- Unit nginx.service has begun starting up.
    Oct 31 22:04:33 alexeymiller nginx[14157]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    Oct 31 22:04:33 alexeymiller nginx[14157]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    Oct 31 22:04:34 alexeymiller nginx[14157]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    Oct 31 22:04:34 alexeymiller nginx[14157]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    Oct 31 22:04:35 alexeymiller nginx[14157]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    Oct 31 22:04:35 alexeymiller nginx[14157]: nginx: [emerg] still could not bind()
    Oct 31 22:04:35 alexeymiller systemd[1]: nginx.service: Control process exited, code=exited status=1
    Oct 31 22:04:35 alexeymiller systemd[1]: Failed to start A high performance web server and a reverse proxy server.
    

    Вероятно, у вас установлен apache2, который использует порт 80.
    Удалите apache2 и повторите попытку.

  2. Вам, вероятно, нужно проверить

    root@sg1:/var/www# service nginx status
    
    * 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 Tue 2018-02-13 00:51:20 UTC; 5min ago
      Process: 5861 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
      Process: 5853 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    
    Feb 13 00:51:18 sg1.tech nginx[5861]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    Feb 13 00:51:18 sg1.tech nginx[5861]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    Feb 13 00:51:19 sg1.tech nginx[5861]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    Feb 13 00:51:19 sg1.tech nginx[5861]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    Feb 13 00:51:20 sg1.tech nginx[5861]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    Feb 13 00:51:20 sg1.tech nginx[5861]: nginx: [emerg] still could not bind()
    Feb 13 00:51:20 sg1.tech systemd[1]: nginx.service: Control process exited, code=exited status=1
    Feb 13 00:51:20 sg1.tech systemd[1]: Failed to start A high performance web server and a reverse proxy server.
    Feb 13 00:51:20 sg1.tech systemd[1]: nginx.service: Unit entered failed state.
    Feb 13 00:51:20 sg1.tech systemd[1]: nginx.service: Failed with result 'exit-code'.
    root@sg1:/var/www#
    

    остановка службы Apache2
    запуск службы nginx