我删除了旧内核(使用 dpkg -P),现在我尝试安装的许多软件包都抱怨缺少旧(已删除)内核作为依赖项
如果我按照建议执行“apt-get install -f”,我的旧内核就会重新安装……
sudo apt-get install synaptic
Reading package lists... Done
Building dependency tree
Reading state information... Done
synaptic is already the newest version (0.83).
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-image-extra-4.10.0-28-generic : Depends: linux-image-4.10.0-28-generic but it is not going to be installed
linux-image-extra-4.10.0-35-generic : Depends: linux-image-4.10.0-35-generic but it is not going to be installed
linux-image-extra-4.10.0-37-generic : Depends: linux-image-4.10.0-37-generic but it is not going to be installed
linux-signed-image-4.10.0-35-generic : Depends: linux-image-4.10.0-35-generic (= 4.10.0-35.39~16.04.1) but it is not going to be installed
linux-signed-image-4.10.0-37-generic : Depends: linux-image-4.10.0-37-generic (= 4.10.0-37.41~16.04.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
答案1
如果软件包 A(此处为linux-image-extra-***
和linux-signed-image-***
)依赖于软件包 B(此处为linux-image-***
),则如果安装了软件包 A 而未安装软件包 B,则会出现问题。有两种方法可以解决此问题:安装软件包 B,或删除软件包 A。
apt-get install -f
尝试执行前者,但是在这里,很明显您想要做的是删除不需要的包,所以只需执行此操作™:
sudo apt remove linux-image-extra-4.10.0-28-generic linux-image-extra-4.10.0-35-generic linux-image-extra-4.10.0-37-generic linux-signed-image-4.10.0-35-generic linux-signed-image-4.10.0-37-generic
是的,全部用一个命令,不用分开。以后请始终使用 Apt 删除软件包,而不是dpkg
。