package nginx-full 1.10.3-0ubuntu0.16.04.2 failed to install/upgrade: 子进程 已安装 post-installation 脚本 返回错误状态 1

Bug #1784529 reported by zhiying zhou
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nginx (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

zhiying@zhiying-Lenovo-XiaoXin-310-15IKB:~$ whereis php
php: /usr/bin/php7.0 /usr/bin/php /usr/lib/php /etc/php /usr/share/php7.0-opcache /usr/share/php7.0-mbstring /usr/share/php7.0-xml /usr/share/php7.0-json /usr/share/php7.0-mysql /usr/share/php /usr/share/php7.0-readline /usr/share/php7.0-gd /usr/share/php7.0-mcrypt /usr/share/php7.0-common /usr/share/man/man1/php.1.gz
zhiying@zhiying-Lenovo-XiaoXin-310-15IKB:~$ clear
zhiying@zhiying-Lenovo-XiaoXin-310-15IKB:~$ sudo apt-get install php7-common libapache2-mod-php7 php7-cli
[sudo] zhiying 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
E: 无法定位软件包 php7-common
E: 无法定位软件包 libapache2-mod-php7
E: 无法定位软件包 php7-cli
zhiying@zhiying-Lenovo-XiaoXin-310-15IKB:~$ apt-get update
正在读取软件包列表... 完成
W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: 不允许的操作)
E: 无法打开锁文件 /var/lib/apt/lists/lock - open (13: 权限不够)
E: 无法对目录 /var/lib/apt/lists/ 加锁
W: 用 unlink 删除文件 /var/cache/apt/pkgcache.bin 出错 - RemoveCaches (13: 权限不够)
W: 用 unlink 删除文件 /var/cache/apt/srcpkgcache.bin 出错 - RemoveCaches (13: 权限不够)
zhiying@zhiying-Lenovo-XiaoXin-310-15IKB:~$ sudo apt-get update
忽略:1 http://dl.google.com/linux/chrome/deb stable InRelease
获取:2 http://archive.ubuntukylin.com:10006/ubuntukylin xenial InRelease [18.1 kB]
命中:3 http://dl.google.com/linux/chrome/deb stable Release
命中:5 http://ppa.launchpad.net/obsproject/obs-studio/ubuntu xenial InRelease
获取:6 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
命中:7 http://cn.archive.ubuntu.com/ubuntu xenial InRelease
获取:8 http://cn.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
获取:9 http://security.ubuntu.com/ubuntu xenial-security/main amd64 DEP-11 Metadata [67.7 kB]
获取:10 http://security.ubuntu.com/ubuntu xenial-security/main DEP-11 64x64 Icons [72.2 kB]
获取:11 http://cn.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
获取:12 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 DEP-11 Metadata [107 kB]
获取:13 http://security.ubuntu.com/ubuntu xenial-security/universe DEP-11 64x64 Icons [147 kB]
获取:14 http://cn.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [819 kB]
获取:15 http://cn.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [746 kB]
获取:16 http://cn.archive.ubuntu.com/ubuntu xenial-updates/main amd64 DEP-11 Metadata [318 kB]
获取:17 http://cn.archive.ubuntu.com/ubuntu xenial-updates/main DEP-11 64x64 Icons [238 kB]
获取:18 http://cn.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [675 kB]
获取:19 http://cn.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [616 kB]
获取:20 http://cn.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 DEP-11 Metadata [247 kB]
获取:21 http://cn.archive.ubuntu.com/ubuntu xenial-updates/universe DEP-11 64x64 Icons [335 kB]
获取:22 http://cn.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 DEP-11 Metadata [5,960 B]
获取:23 http://cn.archive.ubuntu.com/ubuntu xenial-updates/multiverse DEP-11 64x64 Icons [14.3 kB]
获取:24 http://cn.archive.ubuntu.com/ubuntu xenial-backports/main amd64 DEP-11 Metadata [3,328 B]
获取:25 http://cn.archive.ubuntu.com/ubuntu xenial-backports/universe amd64 DEP-11 Metadata [5,100 B]
已下载 4,758 kB,耗时 5秒 (928 kB/s)
AppStream cache update completed, but some metadata was ignored due to errors.
正在读取软件包列表... 完成
zhiying@zhiying-Lenovo-XiaoXin-310-15IKB:~$ sudo apt-get install php7-common libapache2-mod-php7 php7-cli
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
E: 无法定位软件包 php7-common
E: 无法定位软件包 libapache2-mod-php7
E: 无法定位软件包 php7-cli
zhiying@zhiying-Lenovo-XiaoXin-310-15IKB:~$ apt-cache search php7
libapache2-mod-php7.0 - server-side, HTML-embedded scripting language (Apache 2 module)
php-all-dev - package depending on all supported PHP development packages
php7.0 - server-side, HTML-embedded scripting language (metapackage)
php7.0-cgi - server-side, HTML-embedded scripting language (CGI binary)
php7.0-cli - command-line interpreter for the PHP scripting language
php7.0-common - documentation, examples and common module for PHP
php7.0-curl - CURL module for PHP
php7.0-dev - Files for PHP7.0 module development
php7.0-gd - GD module for PHP
php7.0-gmp - GMP module for PHP
php7.0-json - JSON module for PHP
php7.0-ldap - LDAP module for PHP
php7.0-mysql - MySQL module for PHP
php7.0-odbc - ODBC module for PHP
php7.0-opcache - Zend OpCache module for PHP
php7.0-pgsql - PostgreSQL module for PHP
php7.0-pspell - pspell module for PHP
php7.0-readline - readline module for PHP
php7.0-recode - recode module for PHP
php7.0-snmp - SNMP module for PHP
php7.0-sqlite3 - SQLite3 module for PHP
php7.0-tidy - tidy module for PHP
php7.0-xml - DOM, SimpleXML, WDDX, XML, and XSL module for PHP
php7.0-xmlrpc - XMLRPC-EPI module for PHP
libphp7.0-embed - HTML-embedded scripting language (Embedded SAPI library)
php7.0-bcmath - Bcmath module for PHP
php7.0-bz2 - bzip2 module for PHP
php7.0-enchant - Enchant module for PHP
php7.0-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
php7.0-imap - IMAP module for PHP
php7.0-interbase - Interbase module for PHP
php7.0-intl - Internationalisation module for PHP
php7.0-mbstring - MBSTRING module for PHP
php7.0-mcrypt - libmcrypt module for PHP
php7.0-phpdbg - server-side, HTML-embedded scripting language (PHPDBG binary)
php7.0-soap - SOAP module for PHP
php7.0-sybase - Sybase module for PHP
php7.0-xsl - XSL module for PHP (dummy)
php7.0-zip - Zip module for PHP
php7.0-dba - DBA module for PHP
zhiying@zhiying-Lenovo-XiaoXin-310-15IKB:~$ aptitude search php7
程序“aptitude”尚未安装。 您可以使用以下命令安装:
sudo apt install aptitude
zhiying@zhiying-Lenovo-XiaoXin-310-15IKB:~$ sudo apt-get install aptitude
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
下列软件包是自动安装的并且现在不需要了:
  debugedit librpmbuild3 librpmsign3 libsqlite0 python-libxml2 python-lzma
  python-pycurl python-rpm python-sqlite python-sqlitecachec python-urlgrabber
  rpm
使用'sudo apt autoremove'来卸载它(它们)
将会同时安装下列软件:
  aptitude-common libcwidget3v5
建议安装:
  apt-xapian-index aptitude-doc-en | aptitude-doc debtags tasksel
  libcwidget-dev
下列【新】软件包将被安装:
  aptitude aptitude-common libcwidget3v5
升级了 0 个软件包,新安装了 3 个软件包,要卸载 0 个软件包,有 12 个软件包未被升级。
有 2 个软件包没有被完全安装或卸载。
需要下载 2,345 kB 的归档。
解压缩后会消耗 9,865 kB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 http://cn.archive.ubuntu.com/ubuntu xenial/main amd64 aptitude-common all 0.7.4-2ubuntu2 [747 kB]
获取:2 http://cn.archive.ubuntu.com/ubuntu xenial/main amd64 libcwidget3v5 amd64 0.5.17-4ubuntu2 [292 kB]
获取:3 http://cn.archive.ubuntu.com/ubuntu xenial/main amd64 aptitude amd64 0.7.4-2ubuntu2 [1,306 kB]
已下载 2,345 kB,耗时 15秒 (149 kB/s)
正在选中未选择的软件包 aptitude-common。
(正在读取数据库 ... 系统当前共安装有 233368 个文件和目录。)
正准备解包 .../aptitude-common_0.7.4-2ubuntu2_all.deb ...
正在解包 aptitude-common (0.7.4-2ubuntu2) ...
正在选中未选择的软件包 libcwidget3v5:amd64。
正准备解包 .../libcwidget3v5_0.5.17-4ubuntu2_amd64.deb ...
正在解包 libcwidget3v5:amd64 (0.5.17-4ubuntu2) ...
正在选中未选择的软件包 aptitude。
正准备解包 .../aptitude_0.7.4-2ubuntu2_amd64.deb ...
正在解包 aptitude (0.7.4-2ubuntu2) ...
正在处理用于 man-db (2.7.5-1) 的触发器 ...
正在处理用于 libc-bin (2.23-0ubuntu10) 的触发器 ...
正在设置 nginx-core (1.10.3-0ubuntu0.16.04.2) ...
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
invoke-rc.d: initscript nginx, action "start" failed.
● 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 二 2018-07-31 11:14:07 CST; 5ms ago
  Process: 11392 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

7月 31 11:14:07 zhiying-Lenovo-XiaoXin-310-15IKB systemd[1]: Starting A high...
7月 31 11:14:07 zhiying-Lenovo-XiaoXin-310-15IKB nginx[11392]: nginx: [emerg...
7月 31 11:14:07 zhiying-Lenovo-XiaoXin-310-15IKB nginx[11392]: nginx: config...
7月 31 11:14:07 zhiying-Lenovo-XiaoXin-310-15IKB systemd[1]: nginx.service: ...
7月 31 11:14:07 zhiying-Lenovo-XiaoXin-310-15IKB systemd[1]: Failed to start...
7月 31 11:14:07 zhiying-Lenovo-XiaoXin-310-15IKB systemd[1]: nginx.service: ...
7月 31 11:14:07 zhiying-Lenovo-XiaoXin-310-15IKB systemd[1]: nginx.service: ...
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: 处理软件包 nginx-core (--configure)时出错:
 子进程 已安装 post-installation 脚本 返回错误状态 1
dpkg: 依赖关系问题使得 nginx 的配置工作不能继续:
 nginx 依赖于 nginx-core (>= 1.10.3-0ubuntu0.16.04.2) | nginx-full (>= 1.10.3-0ubuntu0.16.04.2) | nginx-light (>= 1.10.3-0ubuntu0.16.04.2) | nginx-extras (>= 1.10.3-0ubuntu0.16.04.2);然而:
  软件包 nginx-core 尚未配置。
  未安装软件包 nginx-full。
  未安装软件包 nginx-light。
  未安装软件包 nginx-extras。
 nginx 依赖于 nginx-core (<< 1.10.3-0ubuntu0.16.04.2.1~) | nginx-full (<< 1.10.3-0ubuntu0.16.04.2.1~) | nginx-light (<< 1.10.3-0ubuntu0.16.04.2.1~) | nginx-extras (<< 1.10.3-0ubuntu0.16.04.2.1~);然而:
  软件包 nginx-core 尚未配置。
  未安装软件包 nginx-full。
  未安装软件包 nginx-light。
  未安装软件包 nginx-extras。

dpkg: 处理软件包 nginx (--configure)时出错:
 依赖关系问题 - 仍未被配置
正在设置 aptitude-common (0.7.4-2ubuntu2) ...
因为错误消息指示这是由于上一个问题导致的错误,没有写入 apport 报告。
                                                                    正在设置 libcwidget3v5:amd64 (0.5.17-4ubuntu2) ...
正在设置 aptitude (0.7.4-2ubuntu2) ...
update-alternatives: 使用 /usr/bin/aptitude-curses 来在自动模式中提供 /usr/bin/aptitude (aptitude)
正在处理用于 libc-bin (2.23-0ubuntu10) 的触发器 ...
在处理时有错误发生:
 nginx-core
 nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)
zhiying@zhiying-Lenovo-XiaoXin-310-15IKB:~$ sudo apt-get install nginx-full
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
下列软件包是自动安装的并且现在不需要了:
  debugedit librpmbuild3 librpmsign3 libsqlite0 python-libxml2 python-lzma
  python-pycurl python-rpm python-sqlite python-sqlitecachec python-urlgrabber
  rpm
使用'sudo apt autoremove'来卸载它(它们)
建议安装:
  nginx-doc
下列软件包将被【卸载】:
  nginx-core
下列【新】软件包将被安装:
  nginx-full
升级了 0 个软件包,新安装了 1 个软件包,要卸载 1 个软件包,有 12 个软件包未被升级。
有 2 个软件包没有被完全安装或卸载。
需要下载 453 kB 的归档。
解压缩后会消耗 71.7 kB 的额外空间。
您希望继续执行吗? [Y/n] n
中止。
zhiying@zhiying-Lenovo-XiaoXin-310-15IKB:~$ sudo apt-get install nginx-full nginx-light nginx-extras
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
有一些软件包无法被安装。如果您用的是 unstable 发行版,这也许是
因为系统无法达到您要求的状态造成的。该版本中可能会有一些您需要的软件
包尚未被创建或是它们已被从新到(Incoming)目录移出。
下列信息可能会对解决问题有所帮助:

下列软件包有未满足的依赖关系:
 nginx-extras : 冲突: nginx-full 但是 1.10.3-0ubuntu0.16.04.2 正要被安装
                冲突: nginx-light 但是 1.10.3-0ubuntu0.16.04.2 正要被安装
 nginx-full : 冲突: nginx-extras 但是 1.10.3-0ubuntu0.16.04.2 正要被安装
              冲突: nginx-light 但是 1.10.3-0ubuntu0.16.04.2 正要被安装
 nginx-light : 冲突: nginx-extras 但是 1.10.3-0ubuntu0.16.04.2 正要被安装
               冲突: nginx-full 但是 1.10.3-0ubuntu0.16.04.2 正要被安装
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
zhiying@zhiying-Lenovo-XiaoXin-310-15IKB:~$ sudo apt-get install nginx-full
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
下列软件包是自动安装的并且现在不需要了:
  debugedit librpmbuild3 librpmsign3 libsqlite0 python-libxml2 python-lzma
  python-pycurl python-rpm python-sqlite python-sqlitecachec python-urlgrabber
  rpm
使用'sudo apt autoremove'来卸载它(它们)
建议安装:
  nginx-doc
下列软件包将被【卸载】:
  nginx-core
下列【新】软件包将被安装:
  nginx-full
升级了 0 个软件包,新安装了 1 个软件包,要卸载 1 个软件包,有 12 个软件包未被升级。
有 2 个软件包没有被完全安装或卸载。
需要下载 453 kB 的归档。
解压缩后会消耗 71.7 kB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 http://cn.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 nginx-full amd64 1.10.3-0ubuntu0.16.04.2 [453 kB]
已下载 453 kB,耗时 8秒 (51.9 kB/s)
dpkg: nginx-core:有依赖问题,但是如您所愿,将继续卸载:
 nginx 依赖于 nginx-core (>= 1.10.3-0ubuntu0.16.04.2) | nginx-full (>= 1.10.3-0ubuntu0.16.04.2) | nginx-light (>= 1.10.3-0ubuntu0.16.04.2) | nginx-extras (>= 1.10.3-0ubuntu0.16.04.2);然而:
  即将删除 nginx-core。
  未安装软件包 nginx-full。
  未安装软件包 nginx-light。
  未安装软件包 nginx-extras。
 nginx 依赖于 nginx-core (<< 1.10.3-0ubuntu0.16.04.2.1~) | nginx-full (<< 1.10.3-0ubuntu0.16.04.2.1~) | nginx-light (<< 1.10.3-0ubuntu0.16.04.2.1~) | nginx-extras (<< 1.10.3-0ubuntu0.16.04.2.1~);然而:
  即将删除 nginx-core。
  未安装软件包 nginx-full。
  未安装软件包 nginx-light。
  未安装软件包 nginx-extras。
 nginx 依赖于 nginx-core (>= 1.10.3-0ubuntu0.16.04.2) | nginx-full (>= 1.10.3-0ubuntu0.16.04.2) | nginx-light (>= 1.10.3-0ubuntu0.16.04.2) | nginx-extras (>= 1.10.3-0ubuntu0.16.04.2);然而:
  即将删除 nginx-core。
  未安装软件包 nginx-full。
  未安
(正在读取数据库 ... 系统当前共安装有 233496 个文件和目录。)
正在卸载 nginx-core (1.10.3-0ubuntu0.16.04.2) ...
正在选中未选择的软件包 nginx-full。
(正在读取数据库 ... 系统当前共安装有 233492 个文件和目录。)
正准备解包 .../nginx-full_1.10.3-0ubuntu0.16.04.2_amd64.deb ...
正在解包 nginx-full (1.10.3-0ubuntu0.16.04.2) ...
正在处理用于 man-db (2.7.5-1) 的触发器 ...
正在设置 nginx-full (1.10.3-0ubuntu0.16.04.2) ...
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
invoke-rc.d: initscript nginx, action "start" failed.
● 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 二 2018-07-31 11:16:17 CST; 4ms ago
  Process: 12081 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

7月 31 11:16:17 zhiying-Lenovo-XiaoXin-310-15IKB systemd[1]: Starting A high...
7月 31 11:16:17 zhiying-Lenovo-XiaoXin-310-15IKB nginx[12081]: nginx: [emerg...
7月 31 11:16:17 zhiying-Lenovo-XiaoXin-310-15IKB nginx[12081]: nginx: config...
7月 31 11:16:17 zhiying-Lenovo-XiaoXin-310-15IKB systemd[1]: nginx.service: ...
7月 31 11:16:17 zhiying-Lenovo-XiaoXin-310-15IKB systemd[1]: Failed to start...
7月 31 11:16:17 zhiying-Lenovo-XiaoXin-310-15IKB systemd[1]: nginx.service: ...
7月 31 11:16:17 zhiying-Lenovo-XiaoXin-310-15IKB systemd[1]: nginx.service: ...
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: 处理软件包 nginx-full (--configure)时出错:
 子进程 已安装 post-installation 脚本 返回错误状态 1
E: Sub-process /usr/bin/dpkg returned an error code (

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: nginx-full 1.10.3-0ubuntu0.16.04.2
ProcVersionSignature: Ubuntu 4.15.0-29.31~16.04.1-generic 4.15.18
Uname: Linux 4.15.0-29-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.18
AptOrdering:
 nginx-core: Remove
 nginx-full: Install
 nginx-full: Configure
 nginx: Configure
 NULL: ConfigurePending
Architecture: amd64
Date: Tue Jul 31 11:16:17 2018
ErrorMessage: 子进程 已安装 post-installation 脚本 返回错误状态 1
InstallationDate: Installed on 2018-04-10 (111 days ago)
InstallationMedia: Ubuntu 16.04.4 LTS "Xenial Xerus" - Release amd64 (20180228)
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.4
 apt 1.2.27
SourcePackage: nginx
Title: package nginx-full 1.10.3-0ubuntu0.16.04.2 failed to install/upgrade: 子进程 已安装 post-installation 脚本 返回错误状态 1
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
zhiying zhou (6zhiying6) wrote :
Revision history for this message
Alex Murray (alexmurray) wrote :

From the logs it looks like this failed since the configuration file for nginx was not found:

7月 31 11:16:17 zhiying-Lenovo-XiaoXin-310-15IKB nginx[12081]: nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
7月 31 11:16:17 zhiying-Lenovo-XiaoXin-310-15IKB nginx[12081]: nginx: configuration file /etc/nginx/nginx.conf test failed

Have you removed this file or is it inaccessible to the nginx process?

information type: Private Security → Public
Revision history for this message
Alex Murray (alexmurray) wrote : Bug is not a security issue

Thanks for taking the time to report this bug and helping to make Ubuntu better. We appreciate the difficulties you are facing, but this appears to be a "regular" (non-security) bug. I have unmarked it as a security issue since this bug does not show evidence of allowing attackers to cross privilege boundaries nor directly cause loss of data/privacy. Please feel free to report any other bugs you may find.

Revision history for this message
Joshua Powers (powersj) wrote :

I am marking this bug as 'Incomplete' pending a response.

Changed in nginx (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for nginx (Ubuntu) because there has been no activity for 60 days.]

Changed in nginx (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.