由于未满足依赖关系而无法删除旧内核映像?

由于未满足依赖关系而无法删除旧内核映像?

我正在尝试删除旧的内核映像,因为我的服务器上没有空间了,但是每当我尝试使用

sudo apt-get remove xxx

我明白了

The following packages have unmet dependencies:
 linux-image-extra-3.13.0-135-generic : Depends: linux-image-3.13.0-135-generic but it is not going to be installed
 linux-image-generic : Depends: linux-image-3.13.0-135-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

服务器没有磁盘空间,所以无法安装依赖项,但由于依赖项未得到满足,也无法删除任何内容?这是什么鬼??

答案1

阅读man apt-get,特别是关于

   -m, --ignore-missing, --fix-missing
       Ignore missing packages; if packages cannot be retrieved or fail the integrity check after retrieval (corrupted package files), hold back those
       packages and handle the result. Use of this option together with -f may produce an error in some situations. If a package is selected for installation
       (particularly if it is mentioned on the command line) and it could not be downloaded then it will be silently held back. Configuration Item:
       APT::Get::Fix-Missing.

答案2

我通常处理这个问题(关于旧内核)的方法是

  • 删除受抚养人包(无论如何它们大多是元包)
  • 清理/释放磁盘空间
  • 重新安装这些元包

对于你的情况,我首先要

sudo apt remove linux-image-generic linux-headers-generic linux-generic

清理后,你恢复原来的情况

sudo apt install linux-generic

(这也会拉入其他元包)

相关内容