由于debconf,无法更新nginx
我的时间是14.04.5 LTS。 运行正常的apt-get升级时出现此错误:
Setting up nginx-common (1.10.1-3+trusty1) ... dpkg: error processing package nginx-common (--configure): subprocess installed post-installation script returned error exit status 1
我已经省略了由此引起的所有后续错误,“包nginx-common尚未配置。”等。
我按照这个答案的过程来调试.postinst
,它永远不会超越第3行: . /usr/share/debconf/confmodule
. /usr/share/debconf/confmodule
– 这就是返回1
。
我已经尝试过这个解决方案,但它没有帮助,debconf绝对可以访问。 而这些 (错误仍然存在)。 据我所知,我在任何包含的conf文件中都没有ipv6 listen指令。
我不知道如何调试debconf以了解它失败的原因。 有谁知道我接下来应该尝试什么?
编辑:新的更新,他们安装,但我最后收到此错误:
Setting up nginx-full (1.10.1-3+trusty2) ... initctl: invalid command: upgrade Try `initctl --help' for more information. invoke-rc.d: initscript nginx, action "upgrade" failed.
不确定我是否应该标记为已解决。
此具体问题已修复,请更新您的包裹!
Ubuntu存储库 ( LP Bug#1637058 )
在Ubuntu Zesty提出的存储库 (这是一个开发中的版本,我希望你没有使用它……), 1.10.1-0ubuntu5
解决了这个问题。
在Ubuntu Trusty,Xenial和Yakkety中,安全团队已经发布了更新版本的软件包来解决这个问题,并且正在考虑将其作为软件包的回归。 此信息在错误中详细说明,并在相应的Ubuntu安全通知(USN-3114-2)中进行了简要介绍,但此问题已在以下版本的软件包中修复:
- Ubuntu Trusty:
1.4.6-1ubuntu3.7
(安全和更新存储库) - Ubuntu Xenial:
1.10.0-0ubuntu0.16.04.4
(安全和更新存储库) - Ubuntu Yakkety:
1.10.1-0ubuntu1.2
(安全和更新存储库)
Ubuntu Precise存储库中的版本不会受到影响,因为它们从未以引入最近更新的CVE的方式进行更改。 (这仅适用于Ubuntu存储库,而不适用于PPA。)
PPA ( LP Bug#1637200 )
我已将修订后的软件包上传到解决此问题的登台PPA,并实施修复。 这些内置没有问题,并于2016年10月27日下午12:56(UTC-04:00)复制到Launchpad上的主要主线和稳定PPA。
这包括对Precise,Trusty,Xenial和Yakkety的修复 。 PPA还没有Zesty的支持。
强制披露:
我是负责
nginx
软件包的Ubuntu服务器团队的主要人员。 我还维护了位于https://launchpad.net/~nginx的团队下的PPA。我也直接了解这个问题,并且修复程序可用,因为我帮助发现问题影响了最近的安全更新以及Debian。
官方固定包已经发布,使用它们
TL; DR滚动到底部
我自己也遇到过这个问题。
为了进一步调试,我设置了以下环境变量:
export DEBCONF_DEBUG=developer
这样我们就可以看到debconf正在做什么。
现在我们跑
dpkg --configure --pending
我们可以看到以下内容:
Setting up nginx-common (1.10.1-3+xenial1) ... debconf (developer): frontend started debconf (developer): frontend running, package name is nginx-common debconf (developer): starting /var/lib/dpkg/info/nginx-common.config configure 1.10.1-3+xenial0 dpkg: error processing package nginx-common (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of libnginx-mod-http-image-filter: libnginx-mod-http-image-filter depends on nginx-common (= 1.10.1-3+xenial1); however: Package nginx-common is not configured yet.
现在我们可以编辑/var/lib/dpkg/info/nginx-common.config
脚本,然后进行更改
#!/bin/sh
同
#!/bin/sh -x
可以启用调试。
再次运行dpkg --configure --pending
将显示:
Setting up nginx-common (1.10.1-3+xenial1) ... debconf (developer): frontend started debconf (developer): frontend running, package name is nginx-common debconf (developer): starting /var/lib/dpkg/info/nginx-common.config configure 1.10.1-3+xenial0 + set -e + . /usr/share/debconf/confmodule + [ ! 1 ] + [ -z ] + exec + [ ] + exec + DEBCONF_REDIR=1 + export DEBCONF_REDIR + logdir=/var/log/nginx + log_symlinks_check 1.10.1-3+xenial0 + [ -z 1.10.1-3+xenial0 ] + dpkg --compare-versions 1.10.1-3+xenial0 lt-nl 1.10.1-0ubuntu1.1 + return dpkg: error processing package nginx-common (--configure):
现在我们可以在脚本中看到我们有问题的一行
dpkg --compare-versions 1.10.1-3+xenial0 lt-nl 1.10.1-0ubuntu1.1
返回退出代码1,因为它应该 – 它正在进行版本比较并根据结果返回0或1。
我不会评论如何正确修复它,因为它是在#1637058(对于Ubuntu)和#1637200(对于PPA)在LP处跟踪的实际错误。
解决方法 :
编辑/var/lib/dpkg/info/nginx-common.config
并在log_symlinks_check
函数的第一行添加一个return
值。
例如:
log_symlinks_check() { return <---- here # Skip new installations [ -z "$1" ] && return
这将允许升级过程继续。
编辑正如@Thomas Ward指出的那样,这将跳过设置步骤(修复不安全的符号链接 - 如果有任何 - 在/ var / log / nginx中)
遇到同样的问题:
-
14.04.5 LTS (GNU/Linux 3.13.0-32-generic x86_64)
-
16.04.1 LTS (GNU/Linux 4.4.0-45-generic x86_64)
设置nginx-common(1.10.1-3 + trusty1)… dpkg:error handling包nginx-common( – configure):安装后的子进程安装后脚本返回错误退出状态1 dpkg:依赖性问题阻止配置libnginx -mod-http-auth-pam:libnginx-mod-http-auth-pam取决于nginx-common(= 1.10.1-3 + trusty1); 但是:尚未配置包nginx-common。
dpkg:error handling包libnginx-mod-http-auth-pam( – configure):依赖性问题 – 保留未配置的dpkg:依赖性问题阻止配置libnginx-mod-http-echo:libnginx-mod-http-echo取决于nginx -common(= 1.10.1-3 + trusty1); 但是:尚未配置包nginx-common。
dpkg:error handling包libnginx-mod-http-echo( – configure):依赖性问题 – 保留未配置处理时遇到错误:nginx-common libnginx-mod-http-auth-pam libnginx-mod-http-echo
解决了
我能够通过首先备份/etc/nginx
文件夹来解决问题。
sudo tar -zcf ~/nginx.tgz /etc/nginx
然后我清除了与系统中的nginx有关的任何事情。 由于触发了依赖性问题,我必须在步骤中执行此操作。
sudo apt-get purge nginx-full sudo apt-get purge nginx-common sudo apt-get purge nginx*
之后,将nginx安装回系统sudo apt-get install nginx-full
。
最后使用sudo tar -zxf ~/nginx.tgz
恢复/etc/nginx
文件夹并使用sudo service nginx restart
希望这可以帮助!