1

Trying to install a LEMP for the first time with no prior experience using this tutorial: How To Install Nginx on Ubuntu 16.04

running Ubuntu 16.04.1 LTS on a fresh instance (scaleway VPS)

Since I was getting errors I tried removing and reinstalling nginx

apt purge nginx
apt autoremove
apt install nginx

but I'm still having issues

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
Errors were encountered while processing:
 nginx-full
 nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

running systemctl status nginx.service:

Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2017-01-09 22:20:18 UTC; 5min ago
  Process: 15561 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

I also tried sudo apt-get install nginx-full which has the following output:

dpkg: error processing package nginx (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 nginx-full
 nginx
  • Try running sudo nginx. Does it give any errors? – Thomas Ward Jan 9 '17 at 22:52
  • @ThomasWard nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol) – Arko Jan 9 '17 at 22:57
0

Check /var/log/nginx/error.log There might be some clue in there for you. I had this:

2017/02/04 14:55:09 [emerg] 25011#25011: mkdir() "/var/cache/nginx/microcache" failed (2: No such file or directory)

So I manually created the /var/cache/nginx subdirectory and re-ran the install and it succeeded.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.