当尝试安装软件包、升级或更新时,我遇到了同样的问题:E:子进程 /usr/bin/dpkg 返回错误代码 (1)

当尝试安装软件包、升级或更新时,我遇到了同样的问题:E:子进程 /usr/bin/dpkg 返回错误代码 (1)
vmiaffossa@phd-vmiaffossa:~$ sudo apt-get install  openjdk-8-jre-headless
sudo: unable to resolve host phd-vmiaffossa
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  ca-certificates-java java-common
Suggested packages:
  default-jre equivs openjdk-8-jre-jamvm fonts-dejavu-extra fonts-ipafont-gothic
  fonts-ipafont-mincho ttf-wqy-microhei ttf-wqy-zenhei fonts-indic
The following NEW packages will be installed:
  ca-certificates-java java-common openjdk-8-jre-headless
0 upgraded, 3 newly installed, 0 to remove and 113 not upgraded.
3 not fully installed or removed.
Need to get 0 B/63,2 MB of archives.
After this operation, 276 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up udev (219-7ubuntu6) ...
Job for systemd-udevd.service failed. See "systemctl status systemd-udevd.service" and "journalctl -xe" for details.
invoke-rc.d: initscript udev, action "restart" failed.
dpkg: error processing package udev (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of systemd:
 systemd depends on udev; however:
  Package udev is not configured yet.

dpkg: error processing package systemd (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
          E: Sub-process /usr/bin/dpkg returned an error code (1)

请问有人可以建议解决方法吗?

答案1

它似乎udev未完全安装或软件包中有错误。

使用sudo dpkg --configure -a应该尝试修复该问题。

如果这不起作用,请在中找到 udev 软件包 /var/cache/apt/archives/udev...,然后使用 中的 .deb dpkg -i --force-all /var/cache/apt/archives/udev...来安装 udev,应该可以解决您遇到的问题。

问题日志文件摘录

Setting up udev (219-7ubuntu6) ... Job for systemd-udevd.service failed. See "systemctl status systemd-udevd.service" and "journalctl -xe" for details. invoke-rc.d: initscript udev, action "restart" failed. dpkg: error processing package udev (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of systemd: systemd depends on udev; however: Package udev is not configured yet.

相关内容