Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nginx installation errors in debian 8.3

Tags:

nginx

debian

Setting up nginx-full (1.6.2-5+deb8u1) ...
Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' 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-full (>= 1.6.2-5+deb8u1) | nginx-light (>= 1.6.2-5+deb8u1) | nginx-extras (>= 1.6.2-5+deb8u1); however:
 Package nginx-full is not configured yet.
 Package nginx-light is not installed.
 Package nginx-extras is not installed.
 nginx depends on nginx-full (<< 1.6.2-5+deb8u1.1~) | nginx-light (<< 1.6.2-5+deb8u1.1~) | nginx-extras (<< 1.6.2-5+deb8u1.1~); however:
 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
Processing triggers for libc-bin (2.19-18+deb8u3) ...
Processing triggers for systemd (215-17+deb8u3) ...
Errors were encountered while processing:
 nginx-full
 nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

Above is the error that is given to me when running sudo apt-get install nginx. I tried removing apache and nginx both and reinstalling but it gives the same error.

like image 724
HAsHpANTs Avatar asked Jun 24 '26 16:06

HAsHpANTs


2 Answers

I had the same problem. I DO NOT have Apache, and nothing else was blocking my port 80. I could NOT install nginx with

sudo apt-get install nginx

nor with

sudo apt-get install nginx-common nginx-full

After one week I stumbled over this little blog: https://etc.banana.fish/?p=75

In this blog, the solution is:

  1. Install nginx-common: sudo apt-get install nginx-common
  2. Remove listen [::]:80 default_server; from /etc/nginx/sites-enabled/default (I made this using the root-user)
  3. Just to be sure, I did reboot my server.
  4. Just to be sure twice, I did sudo apt-get update and then sudo apt-get upgrade.
  5. Now I finally called sudo apt-get install nginx-full and it worked!

Afterwords I could see the Titlescreen of nginx, when I typed in the IP of my remote server!

like image 168
ElectRocnic Avatar answered Jun 28 '26 18:06

ElectRocnic


You didn't post the output of systemctl status nginx.service so this might not be right, but I had this issue because I had an old install of nginx I'd forgotten about.

So, I purged nginx and reinstalled:

    apt-get purge nginx-full nginx-common
    apt-get install nginx-full

Then I received another error, got the details: systemctl status nginx.service

In my case

nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)

So I have another web server listening on port 80.

To fix, I edited the default nginx site nano /etc/nginx/sites-available/default and removed listen on port 80.

I only needed SSL, so:

    server {
        listen 443 ssl;
        //rest of config....
    }
like image 26
Anthony Avatar answered Jun 28 '26 19:06

Anthony



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!