![清除旧内核时出错](https://linux22.com/image/910485/%E6%B8%85%E9%99%A4%E6%97%A7%E5%86%85%E6%A0%B8%E6%97%B6%E5%87%BA%E9%94%99.png)
无论我尝试安装新软件,还是尝试 sudo apt-get upgrade
我总是收到错误有时是这样的:(当我尝试 sudo apt-get upgrade 时)
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-hwe-16.04 : Depends: linux-image-4.15.0-47-generic but it is not installed
linux-modules-extra-4.15.0-43-generic : Depends: linux-image-4.15.0-43-generic but it is not installed or
linux-image-unsigned-4.15.0-43-generic but it is not installed
linux-modules-extra-4.15.0-45-generic : Depends: linux-image-4.15.0-45-generic but it is not installed or
linux-image-unsigned-4.15.0-45-generic but it is not installed
linux-modules-extra-4.15.0-47-generic : Depends: linux-image-4.15.0-47-generic but it is not installed or
linux-image-unsigned-4.15.0-47-generic but it is not installed
E: Unmet dependencies. Try using -f.
有时会出现这种情况:(当我尝试 sudo apt-get purge linux-image-4.15.0-30-generic 时)
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-hwe-16.04 : Depends: linux-image-4.15.0-47-generic but it is not going to be installed
linux-modules-extra-4.15.0-30-generic : Depends: linux-image-4.15.0-30-generic but it is not going to be installed or
linux-image-unsigned-4.15.0-30-generic but it is not going to be installed
linux-modules-extra-4.15.0-43-generic : Depends: linux-image-4.15.0-43-generic but it is not going to be installed or
linux-image-unsigned-4.15.0-43-generic but it is not going to be installed
linux-modules-extra-4.15.0-45-generic : Depends: linux-image-4.15.0-45-generic but it is not going to be installed or
linux-image-unsigned-4.15.0-45-generic but it is not going to be installed
linux-modules-extra-4.15.0-47-generic : Depends: linux-image-4.15.0-47-generic but it is not going to be installed or
linux-image-unsigned-4.15.0-47-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
我该怎么办?现在连安装新软件都变得非常困难。我尝试安装 R,但又因为这些原因失败了(可能是内核依赖项未得到满足)
sudo apt-get -f install 的输出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
amd64-microcode intel-microcode iucode-tool libpython-all-dev libsodium18 libvpx3:i386 linux-headers-4.15.0-32 linux-headers-4.15.0-32-generic
linux-headers-4.15.0-33 linux-headers-4.15.0-33-generic linux-headers-4.15.0-34 linux-headers-4.15.0-34-generic linux-headers-4.15.0-43
linux-headers-4.15.0-43-generic linux-headers-4.15.0-45 linux-headers-4.15.0-45-generic linux-headers-4.15.0-47
linux-headers-4.15.0-47-generic linux-headers-generic-hwe-16.04 linux-image-4.15.0-30-generic linux-image-4.15.0-32-generic
linux-image-4.15.0-33-generic linux-image-4.15.0-34-generic linux-modules-4.15.0-30-generic linux-modules-4.15.0-32-generic
linux-modules-4.15.0-33-generic linux-modules-4.15.0-34-generic linux-modules-extra-4.15.0-30-generic linux-modules-extra-4.15.0-32-generic
linux-modules-extra-4.15.0-33-generic linux-modules-extra-4.15.0-34-generic python-all python-all-dev python-pip python-pip-whl python-wheel
qtdeclarative5-controls-plugin qtdeclarative5-dialogs-plugin thermald
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 330 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up initramfs-tools (0.122ubuntu8.11) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-firmware (1.157.21) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-39-generic
W: Possible missing firmware /lib/firmware/i915/kbl_guc_ver9_14.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_guc_ver8_7.bin for module i915
cat: write error: No space left on device
update-initramfs: failed for /boot/initrd.img-4.15.0-39-generic with 1.
dpkg: error processing package linux-firmware (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for initramfs-tools (0.122ubuntu8.11) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-39-generic
W: Possible missing firmware /lib/firmware/i915/kbl_guc_ver9_14.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_guc_ver8_7.bin for module i915
cat: write error: No space left on device
update-initramfs: failed for /boot/initrd.img-4.15.0-39-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
linux-firmware
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
输出表明您的磁盘空间不足。。。这是真的吗?这些命令需要磁盘区域,即使在命令清理后不会导致额外的磁盘使用量。。。我还会执行建议的“自动删除”以摆脱您不需要的软件包。。。