web-dev-qa-db-ja.com

「サブプロセス/ usr / bin / dpkgがエラーコード(1)を返しました」nginxをインストールしようとしています

nginxをインストールしようとしていますが、次のエラーメッセージが表示されます。

kurt@kurt-ThinkPad:~$ Sudo apt-get install nginx
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gyp libjs-inherits libjs-node-uuid libuv1 libuv1-dev linux-headers-4.4.0-47
  linux-headers-4.4.0-47-generic linux-image-4.4.0-47-generic
  linux-image-extra-4.4.0-47-generic node-abbrev node-ansi
  node-ansi-color-table node-archy node-async node-block-stream
  node-combined-stream node-cookie-jar node-delayed-stream node-forever-agent
  node-form-data node-fstream node-fstream-ignore node-github-url-from-git
  node-glob node-graceful-fs node-gyp node-inherits node-ini
  node-json-stringify-safe node-lockfile node-lru-cache node-mime
  node-minimatch node-mkdirp node-mute-stream node-node-uuid node-nopt
  node-normalize-package-data node-npmlog node-once node-osenv node-qs
  node-read node-read-package-json node-request node-retry node-rimraf
  node-semver node-sha node-sigmund node-slide node-tar node-tunnel-agent
  node-underscore node-which
Use 'Sudo apt autoremove' to remove them.
The following additional packages will be installed:
  nginx-common nginx-core
Suggested packages:
  fcgiwrap nginx-doc
The following NEW packages will be installed:
  nginx nginx-common nginx-core
0 upgraded, 3 newly installed, 0 to remove and 9 not upgraded.
Need to get 458 kB of archives.
After this operation, 1482 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://nl.archive.ubuntu.com/ubuntu xenial-updates/main AMD64 nginx-common all 1.10.0-0ubuntu0.16.04.4 [26,6 kB]
Get:2 http://nl.archive.ubuntu.com/ubuntu xenial-updates/main AMD64 nginx-core AMD64 1.10.0-0ubuntu0.16.04.4 [428 kB]
Get:3 http://nl.archive.ubuntu.com/ubuntu xenial-updates/main AMD64 nginx all 1.10.0-0ubuntu0.16.04.4 [3498 B]
Fetched 458 kB in 0s (685 kB/s)
Preconfiguring packages ...
Selecting previously unselected package nginx-common.
(Reading database ... 501856 files and directories currently installed.)
Preparing to unpack .../nginx-common_1.10.0-0ubuntu0.16.04.4_all.deb ...
Unpacking nginx-common (1.10.0-0ubuntu0.16.04.4) ...
Selecting previously unselected package nginx-core.
Preparing to unpack .../nginx-core_1.10.0-0ubuntu0.16.04.4_AMD64.deb ...
Unpacking nginx-core (1.10.0-0ubuntu0.16.04.4) ...
Selecting previously unselected package nginx.
Preparing to unpack .../nginx_1.10.0-0ubuntu0.16.04.4_all.deb ...
Unpacking nginx (1.10.0-0ubuntu0.16.04.4) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
Processing triggers for systemd (229-4ubuntu12) ...
Setting up nginx-common (1.10.0-0ubuntu0.16.04.4) ...
Setting up nginx-core (1.10.0-0ubuntu0.16.04.4) ...
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.
dpkg: error processing package nginx-core (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nginx:
 nginx depends on nginx-core (>= 1.10.0-0ubuntu0.16.04.4) | nginx-full (>= 1.10.0-0ubuntu0.16.04.4) | nginx-light (>= 1.10.0-0ubuntu0.16.04.4) | nginx-extras (>= 1.10.0-0ubuntu0.16.04.4); however:
  Package nginx-core is not configured yet.
  Package nginx-full is not installed.
  Package nginx-light is not installed.
  Package nginx-extras is not installed.
 nginx depends on nginx-core (<< 1.10.0-0ubuntu0.16.04.4.1~) | nginx-full (<< 1.10.0-0ubuntu0.16.04.4.1~) | nginx-light (<< 1.10.0-0ubuntu0.16.04.4.1~) | nginx-extras (<< 1.10.0-0ubuntu0.16.04.4.1~); however:
  Package nginx-core is not configured yet.
  Package nginx-full is not installed.
  Package nginx-light is not installed.
  Package nginx-extras is not installed.

dpkg: error processing package nginx (--configure):
 dependency problems - leaving No apport report written because the error message indicates its a followup error from a previous failure.
                                                         unconfigured
Processing triggers for systemd (229-4ubuntu12) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Errors were encountered while processing:
 nginx-core
 nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

/var/log/syslogからの関連性のある抜粋を次に示します。

Dec  6 12:04:47 kurt-ThinkPad systemd[1]: Started CUPS Scheduler.
Dec  6 12:04:47 kurt-ThinkPad systemd[1]: Started ACPI event daemon.
Dec  6 12:04:48 kurt-ThinkPad systemd[1]: Reloading.
Dec  6 12:04:48 kurt-ThinkPad systemd[1]: snapd.refresh.timer: Adding 5h 37min 39.335667s random time.
Dec  6 12:04:48 kurt-ThinkPad systemd[1]: Started CUPS Scheduler.
Dec  6 12:04:48 kurt-ThinkPad systemd[1]: Started ACPI event daemon.
Dec  6 12:04:48 kurt-ThinkPad systemd[1]: Reloading.
Dec  6 12:04:49 kurt-ThinkPad systemd[1]: snapd.refresh.timer: Adding 3h 39min 30.123677s random time.
Dec  6 12:04:49 kurt-ThinkPad systemd[1]: Started CUPS Scheduler.
Dec  6 12:04:49 kurt-ThinkPad systemd[1]: Started ACPI event daemon.
Dec  6 12:04:49 kurt-ThinkPad systemd[1]: Starting A high performance web server and a reverse proxy server...
Dec  6 12:04:49 kurt-ThinkPad nginx[6334]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Dec  6 12:04:49 kurt-ThinkPad nginx[6334]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Dec  6 12:04:49 kurt-ThinkPad nginx[6334]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Dec  6 12:04:49 kurt-ThinkPad nginx[6334]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Dec  6 12:04:50 kurt-ThinkPad nginx[6334]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Dec  6 12:04:50 kurt-ThinkPad nginx[6334]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Dec  6 12:04:50 kurt-ThinkPad nginx[6334]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Dec  6 12:04:50 kurt-ThinkPad nginx[6334]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Dec  6 12:04:51 kurt-ThinkPad nginx[6334]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Dec  6 12:04:51 kurt-ThinkPad nginx[6334]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Dec  6 12:04:51 kurt-ThinkPad nginx[6334]: nginx: [emerg] still could not bind()
Dec  6 12:04:51 kurt-ThinkPad systemd[1]: nginx.service: Control process exited, code=exited status=1
Dec  6 12:04:51 kurt-ThinkPad systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Dec  6 12:04:51 kurt-ThinkPad systemd[1]: nginx.service: Unit entered failed state.
Dec  6 12:04:51 kurt-ThinkPad systemd[1]: nginx.service: Failed with result 'exit-code'.

インストールが機能しない理由はありますか? (同様の問題への答え E:サブプロセス/ usr/bin/dpkgはエラーコード(1)[google chromeに関連] を返しました。一部のファイルが破損していることを示唆しています)。

更新

また、開発コミュニティに送信されるUbuntuによって生成されたエラーメッセージも示します。

enter image description here

1
Kurt Peek

行を見る

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

これは、すでにWebサーバーが実行されていることを意味します(nginxが必要とするポート80でリッスンします)。次のコマンドを試して、ポート80を使用しているプロセスを特定します。

netstat -tlnp | fgrep -w :80

そのサーバーをアンインストールするか、80以外のポートを使用するように再構成します。

3
xhienne