我正在尝试安装/更新一些东西(例如 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 也被这个阻止了。现在我真的需要 soap,将来可能会有更多东西。有没有办法解决这个问题,而不会(或尽量减少)对正在运行的 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@Thomas Ward确实取得了一些进展。但我被困在:
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 分钟...但事情已经解决了。感谢 Thomas 的帮助