Ubuntu18.04更新报错


文章目录

错误描述

sudo apt-get upgrade时报错:

root@pc:~# sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
linux-image-generic-hwe-16.04
Use 'sudo apt autoremove' to remove it.
The following packages have been kept back:
compiz compiz-core compiz-gnome compiz-plugins-default fwupd fwupdate fwupdate-signed gnome-session-bin gnome-session-common hud imagemagick imagemagick-6.q16 imagemagick-common libcompizconfig0
libdecoration0 libnss3 metacity-common ubuntu-session unity-gtk-module-common unity-gtk2-module unity-gtk3-module unity-settings-daemon
The following packages will be upgraded:
gir1.2-peas-1.0
1 upgraded, 0 newly installed, 0 to remove and 22 not upgraded.
1 not fully installed or removed.
Need to get 5,700 B of archives.
After this operation, 136 kB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.aliyun.com/ubuntu bionic/main amd64 gir1.2-peas-1.0 amd64 1.22.0-2 [5,700 B]
Fetched 5,700 B in 0s (26.3 kB/s)
(Reading database ... 236958 files and directories currently installed.)
Preparing to unpack .../gir1.2-peas-1.0_1.22.0-2_amd64.deb ...
Unpacking gir1.2-peas-1.0:amd64 (1.22.0-2) over (1.16.0-1ubuntu2) ...
Setting up gir1.2-peas-1.0:amd64 (1.22.0-2) ...
Setting up acpid (1:2.0.28-1ubuntu1) ...
Job for acpid.service failed because of unavailable resources or another system error.
See "systemctl status acpid.service" and "journalctl -xe" for details.
invoke-rc.d: initscript acpid, action "start" failed.
● acpid.service - ACPI event daemon
Loaded: loaded (/lib/systemd/system/acpid.service; disabled; vendor preset: enabled)
Active: failed (Result: resources) since Mon 2021-05-24 20:37:18 CST; 2 weeks 2 days ago
Main PID: 706 (code=exited, status=0/SUCCESS)

610 17:04:45 pc systemd[1]: acpid.service: Failed with result 'resources'.
610 17:04:45 pc systemd[1]: Failed to start ACPI event daemon.
610 17:07:23 pc systemd[1]: acpid.service: Got no socket.
610 17:07:23 pc systemd[1]: acpid.service: Failed to run 'start' task: Invalid argument
610 17:07:23 pc systemd[1]: acpid.service: Failed with result 'resources'.
610 17:07:23 pc systemd[1]: Failed to start ACPI event daemon.
610 17:07:49 pc systemd[1]: acpid.service: Got no socket.
610 17:07:49 pc systemd[1]: acpid.service: Failed to run 'start' task: Invalid argument
610 17:07:49 pc systemd[1]: acpid.service: Failed with result 'resources'.
610 17:07:49 pc systemd[1]: Failed to start ACPI event daemon.
dpkg: error processing package acpid (--configure):
installed acpid package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
acpid
E: Sub-process /usr/bin/dpkg returned an error code (1)

主要是:Job for acpid.service failed because of unavailable resources or another system error.
See “systemctl status acpid.service” and “journalctl -xe” for details.
invoke-rc.d: initscript acpid, action “start” failed.

解决方法

首先尝试:

sudo /etc/init.d/acpid stop
sudo dpkg --configure -a
sudo

还不行如下:

sudo systemctl restart acpid
sudo

成功解决:

root@pc:~# sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
linux-image-generic-hwe-16.04
Use 'sudo apt autoremove' to remove it.
The following packages have been kept back:
compiz compiz-core compiz-gnome compiz-plugins-default fwupd fwupdate fwupdate-signed gnome-session-bin gnome-session-common hud imagemagick imagemagick-6.q16 imagemagick-common libcompizconfig0
libdecoration0 libnss3 metacity-common ubuntu-session unity-gtk-module-common unity-gtk2-module unity-gtk3-module unity-settings-daemon
0 upgraded, 0 newly installed, 0 to remove and 22