我在尝试安装任何软件或更新我的 Ubuntu 系统时遇到错误

我在尝试安装任何软件或更新我的 Ubuntu 系统时遇到错误

最近,我的 Ubuntu 系统出现了问题。每当我尝试安装新软件或更新系统时,都会收到错误,提示空间不足。我查了一下这个问题,发现它显然与我的 /boot 分区有关,因为 /boot 分区已满。

由于我无法在系统上安装任何软件,因此我需要手动删除旧内核文件。我尝试了不同的方法,但仍然收到一些错误,不允许我删除内核文件。

我尝试的最后一种方法是以下命令:

sudo apt-get autoremove linux-image-3.16.0-30-generic

以下几行是终端上最后打印出来的内容:

Removing p11-kit (0.20.2-2ubuntu2) ...
Removing p11-kit-modules:amd64 (0.20.2-2ubuntu2) ...
Removing libgnustep-base1.24 (1.24.0-1ubuntu3) ...
Removing gnustep-base-common (1.24.0-1ubuntu3) ...
Removing gnustep-common (2.6.2-2.1ubuntu1) ...
Removing libobjc4:amd64 (4.8.4-2ubuntu1~14.04.3) ...
Processing triggers for libc-bin (2.19-0ubuntu6.11) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up initramfs-tools (0.103ubuntu4.7) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-firmware (1.127.23) ...
update-initramfs: Generating /boot/initrd.img-3.16.0-76-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-73-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-71-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-62-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-59-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-57-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-53-generic
grep: /boot/config-3.16.0-53-generic: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.16.0-52-generic
grep: /boot/config-3.16.0-52-generic: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.16.0-51-generic
grep: /boot/config-3.16.0-51-generic: No such file or directory

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.16.0-51-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up linux-image-extra-3.16.0-76-generic (3.16.0-76.98~14.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0-76-generic /boot/vmlinuz-3.16.0-76-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0-76-generic /boot/vmlinuz-3.16.0-76-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-76-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.16.0-76-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-3.16.0-76-generic (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for initramfs-tools (0.103ubuntu4.7) ...
update-initramfs: Generating /boot/initrd.img-3.16.0-76-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.16.0-76-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
 linux-image-extra-3.16.0-76-generic
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

有多种方法可以清理未使用或过时的内核。

如果你只有终端,请查看此帖子 如何删除旧内核版本来清理启动菜单?

我个人使用 synaptic 来确保我的所有软件包都是最新的,在整理好启动分区后,您可能也想看看它。

相关内容