我怎么能在ubuntu16中修复这个nginx

时间:2017-08-28 09:51:43

标签: nginx ubuntu-16.04

我比nginx更新,并且在

时收到此错误消息

sudo apt-get install nginx

任何人都可以帮我解决这个问题

        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)

提前谢谢

1 个答案:

答案 0 :(得分:1)

您可以尝试将官方nginx.repo用于Ubuntu(Xenial)

编辑/etc/apt/sources.list并在文件末尾添加以下行:

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

保存文件并运行以下命令:

sudo apt-get update
sudo apt-get install nginx

它应该从nginx官方仓库安装最新的nginx版本。

如果这不起作用,请尝试运行此命令:

apt-get -f install nginx

or

apt-get -f -y install nginx