![无法清除旧内核(依赖性问题),但 /boot 空间不足](https://linux22.com/image/87904/%E6%97%A0%E6%B3%95%E6%B8%85%E9%99%A4%E6%97%A7%E5%86%85%E6%A0%B8%EF%BC%88%E4%BE%9D%E8%B5%96%E6%80%A7%E9%97%AE%E9%A2%98%EF%BC%89%EF%BC%8C%E4%BD%86%20%2Fboot%20%E7%A9%BA%E9%97%B4%E4%B8%8D%E8%B6%B3.png)
我正在运行 Ubuntu 14.04.4 LTS,并且我正在尝试使用 apt-get 安装新软件包。不幸的是,每当我尝试时,我都会收到如下消息:
The following packages have unmet dependencies:
linux-image-extra-3.16.0-70-generic : Depends: linux-image-3.16.0-70-generic but it is not going to be installed
linux-image-generic-lts-utopic : Depends: linux-image-3.16.0-70-generic but it is not going to be installed
linux-signed-image-3.16.0-70-generic : Depends: linux-image-3.16.0-70-generic (= 3.16.0-70.90~14.04.1) but it is not going to be installed
做了一些谷歌搜索,我发现这可能是由于启动分区空间不足造成的(果然,df
显示/boot
为 100%)。但是,每当我尝试运行apt-get
接受的答案中的命令时,我都会遇到与上面相同的错误。
寻找另一个未使用的解决方案apt-get
,我遇到了这个帖子,建议sudo dpkg --purge linux-image-4.2.0-15-generic
在旧的、未使用的内核上使用类似的东西。
dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv $(uname -r)
(来自上述帖子)显示我有几个旧内核处于pi
状态(需要清除,状态是根据安装的这)
uname -r
告诉我我正在运行的内核是 3.16.0-62-generic,所以我认为我应该可以安全地删除这些旧内核。然而,尝试这样做会sudo dpkg --purge linux-image-3.16.0-49-generic
导致:
dpkg: error processing package linux-image-3.16.0-49-generic (--purge):
dependency problems - not removing
Errors were encountered while processing:
linux-image-3.16.0-49-generic
加尔格!我已经无计可施,而且超出了我的深度(对 dpkg 或 apt-get 不太了解),所以我需要一些帮助。
问题:
为什么我无法使用 卸载旧内核
dpkg
?如果这个问题不能直接解决,我想最终我想知道:我需要做什么才能进入可以再次安装新软件包的状态?
我尝试过的其他事情:
sudo apt-get autoremove
:导致有关未满足依赖关系的原始错误sudo apt-get -f autoremove
: 结果是:
Unpacking linux-image-3.16.0-70-generic (3.16.0-70.90~14.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-3.16.0-70-generic_3.16.0-70.90~14.04.1_amd64.deb (--unpack):
cannot copy extracted data for './boot/vmlinuz-3.16.0-70-generic' to '/boot/vmlinuz-3.16.0-70-generic.dpkg-new': failed to write (No space left on device)
No apport report written because the error message indicates a disk full error
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.16.0-70-generic /boot/vmlinuz-3.16.0-70-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.16.0-70-generic /boot/vmlinuz-3.16.0-70-generic
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-3.16.0-70-generic_3.16.0-70.90~14.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
我想告诉内核的输出dpkg
取决于:
linux-image-extra-3.16.0-49-generic
说明告诉您应该首先清除它(或使用相同的命令)。我已经更新了 Ubuntu 社区帮助 Wiki 中的说明,当前位于: