How do I ignore unmet dependencies while using apt-get remove?
I have a thin VPS running Ubuntu 14.04 with automatic security updates. It has filled up the /boot partition with a lot of kernel updates. I am trying to remove the older ones, but I'm running into an "unmet" dependencies error demanding I fix another package before I can continue. Unfortunately, the unmet dependency wants to install a new kernel to the partition that is 100% full.
$ sudo apt-get remove [an old linux-image* package]
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-image-extra-3.13.0-88-generic : Depends: linux-image-3.13.0-88-generic but it is not going to be installed
linux-image-generic : Depends: linux-image-3.13.0-88-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
With the partition full, there is no way I can apt-get -f install
to correct anything. Is there a way to tell apt-get
to not check for unmet dependencies in the database, which have nothing to do with the packages I need to remove? Once I free up some space, I can actually solve the broken packages too.
My alternate solution is to manually free up space by moving some kernels out of the way (to /kernels
), fix the dependency issue, remove some kernel packages, and move /kernels/*
back if I cannot instruct apt-get
to cooperate otherwise.
EDIT
I tried apt-get -f remove PACKAGENAME
, but it hit the dep error. But apt-get -f autoremove
ignored the dep problems. Without -f, autoremove hit the dep error. With it, some kernels were found for removal and it is working on it. So while my immediate problem is resolved, I still would like to know if the regular apt-get -f remove PACKAGENAME
can have the same capability of ignoring unrelated dependency issues.
Solution 1:
dpkg --remove
DOES remove the packages without complaining about the failed install. That get you disk space to do apt-get -f autoremove