0

I removed old kernels (with dpkg -P), and now many packages that I try to install complain that the miss the old (removed) kernels as dependencies

If I do a "apt-get install -f" as suggested, my old kernels get reinstalled....

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).
Max L.
  • 165

1 Answers1

3

If package A (here, linux-image-extra-*** and linux-signed-image-***) depends on package B (here, linux-image-***), it is a problem if package A is installed while package B is not. There are two ways to solve this problem: install package B, or remove package A.

apt-get install -f tries to do the former, but here, it is clear that what you want to do is remove the unwanted packages, so just do it™:

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

Yes, all in one command, not separately. And in the future, please always remove package with Apt, not dpkg.

fkraiem
  • 12,555
  • 4
  • 35
  • 40