我正在尝试安装阿帕奇2在 Ubuntu 16.04 上。使用的命令是:
sudo apt-get install apache2
报告以下错误:
Setting up linux-image-4.4.0-66-generic (4.4.0-66.87) ...
Running depmod.
Failed to run depmod
dpkg: error processing package linux-image-4.4.0-66-generic (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-extra-4.4.0-66-generic:
linux-image-extra-4.4.0-66-generic depends on linux-image-4.4.0-66-generic; however:
Package linux-image-4.4.0-66-generic is not configured yet.
dpkg: error processing package linux-image-extra-4.4.0-66-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-image-4.4.0-66-generic; however:
Package linux-image-4.4.0-66-generic is not configured yet.
linux-image-generic depends on linux-image-extra-4.4.0-66-generic; however:
Package linux-image-extra-4.4.0-66-generic is not configured yet.
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: error processing package linux-image-generic (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-image-generic (= 4.4.0.66.70); however:
Package linux-image-generic is not configured yet.
dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Errors were encountered while processing:
linux-image-4.4.0-66-generic
linux-image-extra-4.4.0-66-generic
linux-image-generic
linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
我是 Ubuntu 的新用户。请告诉我如何解决这个问题?
谢谢
Sakshi
答案1
Apache2 依赖于另一个包 (linux-generic),该包配置不正确。运行命令
sudo dpkg--configure-a
并且它应该能够自我纠正。
此命令的作用:Sudo(以 root 权限执行此命令,因为普通用户不得使用 dpkg)Dpkg(用于与软件包交互的程序)--configure(传递给 dpkg 的参数,例如“这是我希望你做的,dpkg:配置一些包)-a(自动:不配置特定包,而是配置需要配置的任何包)
如果不起作用,请尝试运行
sudo apt-get 安装 -f(修复损坏的软件包)然后尝试运行
sudo dpkg--configure-a再次。