1

Every time I run sudo apt-get update an error is getting thrown regarding nginx.

The following NEW packages will be installed:
nginx
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
1 not fully installed or removed.
Need to get 0 B/3.498 B of archives.
After this operation, 37,9 kB of additional disk space will be used.
Selecting previously unselected package nginx.
(Reading database ... 542828 files and directories currently installed.)
Preparing to unpack .../nginx_1.10.0-0ubuntu0.16.04.4_all.deb ...
Unpacking nginx (1.10.0-0ubuntu0.16.04.4) ...
Setting up nginx-full (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-full (--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 installed.
Package nginx-full is not configured yet.
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 installed.
Package nginx-full is not configured yet.
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-full
nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've tried to resolve as suggested in other posts without success:

sudo apt-get remove nginx
sudo apt-get -f install    # (as mentioned in this post)
$ 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: enabled)
Active: failed (Result: exit-code) since Mo 2016-11-07 21:05:51 CET; 7min ago
Process: 10372 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

I also tried the following... as the error persists.

apt purge nginx
apt autoremove
apt install nginx

How many options do I have from here to get on the right track?

Should I try uninstalling/disabling apache2?

Zanna
  • 70,465

1 Answers1

1

Shutting down apache2 first before installing nginx should fix this problem.

stop apache2

sudo systemctl stop apache2.service

prevent apache2 to start at boot

sudo systemctl disable apache2.service

Reinstall nginx

sudo apt-get install nginx
Zanna
  • 70,465