我的 /boot/ 分区已满,无法清除旧内核,我一直在尝试这里的建议,但没有成功如何在 /boot 中释放更多空间?
dpkg -l linux-image-\* | grep ^ii
ii linux-image-4.4.0-71-generic 4.4.0-71.92 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-72-generic 4.4.0-72.93 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-75-generic 4.4.0-75.96 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-78-generic 4.4.0-78.99 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-79-generic 4.4.0-79.100 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-81-generic 4.4.0-81.104 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-83-generic 4.4.0-83.106 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-87-generic 4.4.0-87.110 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-89-generic 4.4.0-89.112 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-71-generic 4.4.0-71.92 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-72-generic 4.4.0-72.93 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-75-generic 4.4.0-75.96 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-78-generic 4.4.0-78.99 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-79-generic 4.4.0-79.100 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-81-generic 4.4.0-81.104 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-83-generic 4.4.0-83.106 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-87-generic 4.4.0-87.110 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
sudo apt-get update 建议我尝试不使用任何包的“apt-get -f install”(或指定解决方案)。
我的努力所得到的回报是:
The following packages have unmet dependencies.
linux-image-extra-4.4.0-93-generic : Depends: linux-image-4.4.0-93-generic but it is not going to be installed
linux-image-extra-4.4.0-96-generic : Depends: linux-image-4.4.0-96-generic but it is not going to be installed
linux-image-generic : Depends: linux-image-4.4.0-96-generic but it is not going to be installed
Recommends: thermald but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
sudo apt-get autoremove 返回
sudo apt-get autoremove
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-4.4.0-93-generic : Depends: linux-image-4.4.0-93-generic but it is not installed
linux-image-extra-4.4.0-96-generic : Depends: linux-image-4.4.0-96-generic but it is not installed
linux-image-generic : Depends: linux-image-4.4.0-96-generic but it is not installed
Recommends: thermald but it is not installed
E: Unmet dependencies. Try using -f.
答案1
apt-get autoremove
。
正如您自己所想的那样,您必须先手动删除旧内核。
运行后apt-get autoremove
,您的启动分区应该会空很多。我个人有一个 root cron 每周执行此操作,因此我不会遇到您的情况。
确保您执行了update
和upgrade
也解决了依赖性问题,然后重新启动以启动新内核。
答案2
一旦空间不足,并且软件包只安装了一半,apt 就会放弃。您必须删除一些软件包以sudo dpkg -r xxxxx
获得一些可用空间,然后才能使用 apt 删除更多软件包。