取決於: nginx-common (= 1.10.1-3+xenial2) 但要安裝 1.10.1-0+xenial0

取決於: nginx-common (= 1.10.1-3+xenial2) 但要安裝 1.10.1-0+xenial0

我正在嘗試安裝/更新東西(例如 php7.0-soap),但此訊息不斷出現。

    The following packages have unmet dependencies:
     libnginx-mod-http-auth-pam : Depends: nginx-common (= 1.10.1-3+xenial2) but 1.10.1-0+xenial0 is to be installed
     libnginx-mod-http-echo : Depends: nginx-common (= 1.10.1-3+xenial2) but 1.10.1-0+xenial0 is to be installed
     libnginx-mod-http-geoip : Depends: nginx-common (= 1.10.1-3+xenial2) but 1.10.1-0+xenial0 is to be installed
     libnginx-mod-http-image-filter : Depends: nginx-common (= 1.10.1-3+xenial2) but 1.10.1-0+xenial0 is to be installed
     libnginx-mod-http-subs-filter : Depends: nginx-common (= 1.10.1-3+xenial2) but 1.10.1-0+xenial0 is to be installed
     libnginx-mod-http-upstream-fair : Depends: nginx-common (= 1.10.1-3+xenial2) but 1.10.1-0+xenial0 is to be installed
     libnginx-mod-http-xslt-filter : Depends: nginx-common (= 1.10.1-3+xenial2) but 1.10.1-0+xenial0 is to be installed
     libnginx-mod-mail : Depends: nginx-common (= 1.10.1-3+xenial2) but 1.10.1-0+xenial0 is to be installed
     libnginx-mod-stream : Depends: nginx-common (= 1.10.1-3+xenial2) but 1.10.1-0+xenial0 is to be installed

apt-update 也被這個阻止了。現在我真的需要肥皂,將來可能會更多。有沒有辦法解決這個問題,而不會對正在運行的 nginx 伺服器產生影響(或影響最小),該伺服器通常一次為 300-600 個使用者提供服務。

我們正在使用:Ubuntu 16.04.1 LTS

    lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 16.04.1 LTS
    Release:        16.04
    Codename:       xenial

2017 年 1 月 1 日更新:

按照建議在“apt-get dist-upgrade”或“apt-get install”中使用 -f@托馬斯沃德確實取得了一些進展。但我被困在:

    Unpacking nginx-common (1.10.1-3+xenial2) over (1.10.1-0+xenial0) ...
    dpkg: error processing archive /var/cache/apt/archives/nginx-common_1.10.1-3+xen                                 ial2_all.deb (--unpack):
     trying to overwrite '/etc/logrotate.d/nginx', which is also in package nginx 1.                                 11.3-1~xenial
    Preparing to unpack .../nginx-full_1.10.1-3+xenial2_amd64.deb ...
    Unpacking nginx-full (1.10.1-3+xenial2) over (1.10.1-0+xenial0) ...
    dpkg: error processing archive /var/cache/apt/archives/nginx-full_1.10.1-3+xenia                                 l2_amd64.deb (--unpack):
     trying to overwrite '/usr/sbin/nginx', which is also in package nginx 1.11.3-1~                                 xenial
    dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
    Preparing to unpack .../init-system-helpers_1.29ubuntu4_all.deb ...
    Unpacking init-system-helpers (1.29ubuntu4) over (1.29ubuntu3) ...
    Processing triggers for man-db (2.7.5-1) ...
    Errors were encountered while processing:
     /var/cache/apt/archives/nginx-common_1.10.1-3+xenial2_all.deb
     /var/cache/apt/archives/nginx-full_1.10.1-3+xenial2_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

我明白它在說什麼,但我不知道該怎麼做。

答案1

我最終清除了那些 libnginx-mod-...然後清除了 nginxfull 和 nginx-common。

然後“dpkg -i --force-overwrite”任何阻礙的文件。最後恢復 /etc/nginx 中的 nginx 設定檔(當然我之前備份過)。

伺服器宕機了大約 5-10 分鐘……但事情已經完成了。感謝托馬斯的幫助

相關內容