我目前正在切换我的 VPS 托管,并且在 Ubuntu 22.04 LTS 上不断遇到此错误,我收到的错误是needrestart is being skipped since dpkg has failed E: Sub-process /usr/bin/dpkg returned an error code (1)
我已经尝试了互联网上的所有方法,甚至安装了较新的内核。
完整输出:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libnginx-mod-http-geoip2 libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter libnginx-mod-mail
libnginx-mod-stream libnginx-mod-stream-geoip2 nginx-common nginx-core
Suggested packages:
fcgiwrap nginx-doc
The following NEW packages will be installed:
libnginx-mod-http-geoip2 libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter libnginx-mod-mail
libnginx-mod-stream libnginx-mod-stream-geoip2 nginx nginx-common nginx-core
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/696 kB of archives.
After this operation, 2,395 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Preconfiguring packages ...
Selecting previously unselected package nginx-common.
(Reading database ... 160422 files and directories currently installed.)
Preparing to unpack .../0-nginx-common_1.18.0-6ubuntu14.1_all.deb ...
Unpacking nginx-common (1.18.0-6ubuntu14.1) ...
Selecting previously unselected package libnginx-mod-http-geoip2.
Preparing to unpack .../1-libnginx-mod-http-geoip2_1.18.0-6ubuntu14.1_amd64.deb ...
Unpacking libnginx-mod-http-geoip2 (1.18.0-6ubuntu14.1) ...
Selecting previously unselected package libnginx-mod-http-image-filter.
Preparing to unpack .../2-libnginx-mod-http-image-filter_1.18.0-6ubuntu14.1_amd64.deb ...
Unpacking libnginx-mod-http-image-filter (1.18.0-6ubuntu14.1) ...
Selecting previously unselected package libnginx-mod-http-xslt-filter.
Preparing to unpack .../3-libnginx-mod-http-xslt-filter_1.18.0-6ubuntu14.1_amd64.deb ...
Unpacking libnginx-mod-http-xslt-filter (1.18.0-6ubuntu14.1) ...
Selecting previously unselected package libnginx-mod-mail.
Preparing to unpack .../4-libnginx-mod-mail_1.18.0-6ubuntu14.1_amd64.deb ...
Unpacking libnginx-mod-mail (1.18.0-6ubuntu14.1) ...
Selecting previously unselected package libnginx-mod-stream.
Preparing to unpack .../5-libnginx-mod-stream_1.18.0-6ubuntu14.1_amd64.deb ...
Unpacking libnginx-mod-stream (1.18.0-6ubuntu14.1) ...
Selecting previously unselected package libnginx-mod-stream-geoip2.
Preparing to unpack .../6-libnginx-mod-stream-geoip2_1.18.0-6ubuntu14.1_amd64.deb ...
Unpacking libnginx-mod-stream-geoip2 (1.18.0-6ubuntu14.1) ...
Selecting previously unselected package nginx-core.
Preparing to unpack .../7-nginx-core_1.18.0-6ubuntu14.1_amd64.deb ...
Unpacking nginx-core (1.18.0-6ubuntu14.1) ...
Selecting previously unselected package nginx.
Preparing to unpack .../8-nginx_1.18.0-6ubuntu14.1_amd64.deb ...
Unpacking nginx (1.18.0-6ubuntu14.1) ...
Setting up nginx-common (1.18.0-6ubuntu14.1) ...
chown: invalid group: ‘root:adm’
dpkg: error processing package nginx-common (--configure):
installed nginx-common package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of libnginx-mod-http-xslt-filter:
libnginx-mod-http-xslt-filter depends on nginx-common (= 1.18.0-6ubuntu14.1); however:
Package nginx-common is not configured yet.
dpkg: error processing package libnginx-mod-http-xslt-filter (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libnginx-mod-http-geoip2:
libnginx-mod-http-geoip2 depends on nginx-common (= 1.18.0-6ubuntu14.1); however:
Package nginx-common is not configured yet.
dpkg: error processing package libnginx-mod-http-geoip2 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libnginx-mod-stream-geoip2:
libnginx-mod-stream-geoip2 depends on nginx-common (= 1.18.0-6ubuntu14.1); however:
Package nginx-common is not configured yet.
dpkg: error processing package libnginx-mod-stream-geoip2 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of nginx-core:
nginx-core depends on libnginx-mod-http-xslt-filter (= 1.18.0-6ubuntu14.1); however:
Package libnginx-mod-http-xslt-filter is not configured yet.
nginx-core depends on libnginx-mod-http-geoip2 (= 1.18.0-6uNo apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
buntu14.1); however:
Package libnginx-mod-http-geoip2 is not configured yet.
nginx-core depends on libnginx-mod-stream-geoip2 (= 1.18.0-6ubuntu14.1); however:
Package libnginx-mod-stream-geoip2 is not configured yet.
nginx-core depends on nginx-common (= 1.18.0-6ubuntu14.1); however:
Package nginx-common is not configured yet.
dpkg: error processing package nginx-core (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libnginx-mod-mail:
libnginx-mod-mail depends on nginx-common (= 1.18.0-6ubuntu14.1); however:
Package nginx-common is not configured yet.
dpkg: error processing package libnginx-mod-mail (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of nginx:
nginx depends on nginx-core (<< 1.18.0-6ubuntu14.1.1~) | nginx-full (<< 1.18.0-6ubuntu14.1.1~) | nginx-light (<< 1.18.0-6ubuntu14.1.1~) | nginx-extras (<< 1.18.0-6ubuntu14.1.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.18.0-6ubuntu14.1) | nginx-full (>= 1.18.0-6ubuntu14.1) | nginx-light (>= 1.18.0-6ubuntu14.1) | nginx-extras (>= 1.18.0-6ubuntu14.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 unconfigured
dpkg: dependency problems prevent configuration of libnginx-mod-http-image-filter:
libnginx-mod-http-image-filter depends on nginx-common (= 1.18.0-6ubuntu14.1); however:
Package nginx-common is not configured yet.
dpkg: error processing package libnginx-mod-http-image-filter (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libnginx-mod-stream:
libnginx-mod-stream depends on nginx-common (= 1.18.0-6ubuntu14.1); however:
Package nginx-common is not configured yet.
dpkg: error processing package libnginx-mod-stream (--configure):
dependency problems - leaving unconfigured
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for ufw (0.36.1-4build1) ...
Errors were encountered while processing:
nginx-common
libnginx-mod-http-xslt-filter
libnginx-mod-http-geoip2
libnginx-mod-stream-geoip2
nginx-core
libnginx-mod-mail
nginx
libnginx-mod-http-image-filter
libnginx-mod-stream
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
我最近也遇到了这个问题。确切的错误是
chown: invalid group: ‘root:adm’
adm
Ubuntu默认没有组。您可以手动添加组 adm。
sudo addgroup adm
答案2
命令组添加管理员
在安装 nginx 时,它对我有用。然后,我继续进行剩余的安装,该安装之前因以下命令错误而停止:
sudo apt 安装-f
希望这可以帮助。