Kalaiselvan
Kalaiselvan

Reputation: 2134

how can i fix this nginx in ubuntu16

I am newer to nginx and am getting this error message while

sudo apt-get install nginx

can any one help me to fix this

        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 Mon 2017-08-28 15:12:09 IST; 20ms ago
    Docs: man:nginx(8)
    Process: 6656 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

    Aug 28 15:12:09 onlyoffice systemd[1]: Starting A high performance web serv.....
    Aug 28 15:12:09 onlyoffice nginx[6656]: nginx: [emerg] open() "/etc/nginx/ng...)
    Aug 28 15:12:09 onlyoffice nginx[6656]: nginx: configuration file /etc/nginx...d
    Aug 28 15:12:09 onlyoffice systemd[1]: nginx.service: Control process exite...=1
    Aug 28 15:12:09 onlyoffice systemd[1]: Failed to start A high performance w...r.
    Aug 28 15:12:09 onlyoffice systemd[1]: nginx.service: Unit entered failed state.
    Aug 28 15:12:09 onlyoffice systemd[1]: nginx.service: Failed with result 'e...'.
    Hint: Some lines were ellipsized, use -l to show in full.
    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.13.3-0+xenial1.1~) | nginx-light (<< 1.13.3-0+xenial1.1~) | nginx-extras (<< 1.13.3-0+xenial1.1~); 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.13.3-0+xenial1) | nginx-light (>= 1.13.3-0+xenial1) | nginx-extras (>= 1.13.3-0+xenial1); 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
    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)

thank you in advance

Upvotes: 0

Views: 394

Answers (1)

Bogdan Stoica
Bogdan Stoica

Reputation: 4539

You could try to use the official nginx.repo for Ubuntu (Xenial)

Edit /etc/apt/sources.list and add these lines at the end of the file:

deb http://nginx.org/packages/ubuntu/ codename nginx
deb-src http://nginx.org/packages/ubuntu/ codename nginx

Save the file and run this commands:

sudo apt-get update
sudo apt-get install nginx

It should install the latest nginx version from the nginx official repo.

If that's not working try running this command instead:

apt-get -f install nginx

or

apt-get -f -y install nginx

Upvotes: 1

Related Questions