我无法在我的 ubuntu 服务器上安装任何依赖项或包。
我已尝试删除 Nginx 及其所有组件。
我尝试重新安装多次
我尝试停止 Apache 和 Nginx
我已尝试重新启动服务器。
我不断收到以下消息:
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 Tue 2020-09-08 21:56:04 BST; 12ms ago
Docs: man:nginx(8)
Process: 88379 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Main PID: 1802 (code=killed, signal=KILL)
Sep 08 21:56:04 Linux systemd[1]: Starting A high performance web server and a reverse proxy server...
Sep 08 21:56:04 Linux nginx[88379]: nginx: [emerg] dlopen() "/usr/share/nginx/modules/ngx_http_geoip_module.so" failed (/usr/share/nginx/modules/ngx_http_geoip_module.so: cannot open shared object file: No such file or directory) in /etc/nginx/modules-enabled/50-mod-http-geoip.conf:1
Sep 08 21:56:04 Linux nginx[88379]: nginx: configuration file /etc/nginx/nginx.conf test failed
Sep 08 21:56:04 Linux systemd[1]: nginx.service: Control process exited, code=exited status=1
Sep 08 21:56:04 Linux systemd[1]: nginx.service: Failed with result 'exit-code'.
Failed to start A high performance web server and a reverse proxy server.
dpkg: error processing package nginx-core (--configure):
installed nginx-core package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of nginx:
nginx depends on nginx-core (<< 1.14.0-0ubuntu1.7.1~) | nginx-full (<< 1.14.0-0ubuntu1.7.1~) | nginx-light (<< 1.14.0-0ubuntu1.7.1~) | nginx-extras (<< 1.14.0-0ubuntu1.7.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.
nginx depends on nginx-core (>= 1.14.0-0ubuntu1.7) | nginx-full (>= 1.14.0-0ubuntu1.7) | nginx-light (>= 1.14.0-0ubuntu1.7) | nginx-extras (>= 1.14.0-0ubuntu1.7); 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 unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for systemd (237-3ubuntu10.42) ...
Errors were encountered while processing:
nginx-core
nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)
我该如何修复此警告并重新安装 nginx?
添加apt install libnginx-mod-http-geoip
回复
root@Linux:/etc/nginx/modules-enabled# apt install libnginx-mod-http-geoip
Reading package lists... Done
Building dependency tree
Reading state information... Done
libnginx-mod-http-geoip is already the newest version (1.14.0-0ubuntu1.7).
The following packages were automatically installed and are no longer required:
linux-azure-5.3-cloud-tools-5.3.0-1035 linux-azure-5.3-tools-5.3.0-1035 linux-cloud-tools-5.3.0-1035-azure linux-image-5.3.0-1035-azure linux-modules-5.3.0-1035-azure linux-modules-extra-5.3.0-1035-azure
linux-tools-5.3.0-1035-azure
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up nginx-core (1.14.0-0ubuntu1.7) ...
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 Tue 2020-09-08 22:20:40 BST; 11ms ago
Docs: man:nginx(8)
Process: 115846 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Main PID: 1802 (code=killed, signal=KILL)
Sep 08 22:20:40 Linux systemd[1]: Starting A high performance web server and a reverse proxy server...
Sep 08 22:20:40 Linux nginx[115846]: nginx: [emerg] dlopen() "/usr/share/nginx/modules/ngx_http_image_filter_module.so" failed (/usr/share/nginx/modules/ngx_http_image_filter_module.so: cannot open shared object file: No such file or directory) in /etc/nginx/modules-enabled/50-mod-http-image-filter.conf:1
Sep 08 22:20:40 Linux nginx[115846]: nginx: configuration file /etc/nginx/nginx.conf test failed
Sep 08 22:20:40 Linux systemd[1]: nginx.service: Control process exited, code=exited status=1
Sep 08 22:20:40 Linux systemd[1]: nginx.service: Failed with result 'exit-code'.
Sep 08 22:20:40 Linux systemd[1]: Failed to start A high performance web server and a reverse proxy server.
dpkg: error processing package nginx-core (--configure):
installed nginx-core package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
nginx-core
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@RapioLinux:/etc/nginx/modules-enabled#
也有sudo apt-get install nginx-full
回报
root@Linux:/etc/nginx/sites-enabled# sudo apt-get install nginx-full nginx-light nginx-extras
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
nginx-extras : Conflicts: nginx-full but 1.14.0-0ubuntu1.7 is to be installed
Conflicts: nginx-light but 1.14.0-0ubuntu1.7 is to be installed
nginx-full : Conflicts: nginx-extras but 1.14.0-0ubuntu1.7 is to be installed
Conflicts: nginx-light but 1.14.0-0ubuntu1.7 is to be installed
nginx-light : Conflicts: nginx-extras but 1.14.0-0ubuntu1.7 is to be installed
Conflicts: nginx-full but 1.14.0-0ubuntu1.7 is to be installed
E: Unable to correct problems, you have held broken packages.