我的软件包系统卡住了,因为尝试清理 /boot 以便进行更新。现在我处于以下情况:
sudo apt-get -f install
失败,因为它尝试安装一个软件包,但出现 /boot 磁盘已满错误。尝试删除软件包不起作用:
sudo apt-get --force-yes remove linux-image-extra-4.4.0-119-generic linux-image-extra-4.4.0-97-generic linux-signed-image-4.4.0-119-generic linux-signed-image-4.4.0-97-generic
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-generic : Depends: linux-image-4.4.0-119-generic but it is not going to be installed
Depends: linux-image-extra-4.4.0-119-generic but it is not going to be installed
linux-signed-image-generic : Depends: linux-signed-image-4.4.0-119-generic but it is not going to be installed
Depends: linux-image-extra-4.4.0-119-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
看起来您没有足够的空间容纳新的 Linux 内核,因此您必须删除旧的内核。
首先,运行此命令:
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'
这将向您显示哪些软件包将被删除。确保您当前的内核版本不在该列表中。运行uname -a
以查看您的内核版本。
接下来,运行此命令使用 删除每个文件dpkg --remove
。您也可以在命令前的第一部分中复制名称dpkg --remove
。
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs dpkg --remove
最后,您将能够运行sudo apt-get -f install
。